Proper setup for gcc - OS2

This is a discussion on Proper setup for gcc - OS2 ; Hallo, I'd like to do some modifications to a project that was developed using gcc (it contains inline assembly, therefore, it's relevant). 1.) Can someone tell me how to properly set up gcc: what do I need ? Where do ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 22

Thread: Proper setup for gcc

  1. Proper setup for gcc

    Hallo,

    I'd like to do some modifications to a project that was developed using
    gcc (it contains inline assembly, therefore, it's relevant).

    1.) Can someone tell me how to properly set up gcc: what do I need ?
    Where do I get it ? Can I use OS/2 toolkit import libs with it ?
    2.) the project uses MMOS2. Will the emx import library os2me also work
    with the current gcc compiler ?
    3.) I'd like to debug with VAC's debugger. Is it still possible to
    compile with IBM compatible debug info instead of compiling with gcc's
    native debug info (I remember some -Zomf flag) ? In other words, I want
    to use .obj and .lib files and not .o and .a files ...
    4.) The project comes with some autoconf related files etc.. Honestly, I
    don't have the faintest idea of how to modify all these config files to
    use different compiler flags etc. . Could someone shed some light on
    this or point me to a good manual in the internet ?

    Thanks,
    Lars

  2. Re: Proper setup for gcc

    Hi Lars,

    On Sun, 14 Sep 2008 07:59:19 UTC, Lars Erdmann
    wrote:

    > I'd like to do some modifications to a project that was developed using
    > gcc (it contains inline assembly, therefore, it's relevant).
    >
    > 1.) Can someone tell me how to properly set up gcc: what do I need ?
    > Where do I get it ? Can I use OS/2 toolkit import libs with it ?

    For just GCC - look at
    ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd3.zip

    For a ready to use build environment, with all sorts of pre-built
    libraries - take a look at my build environment at
    http://www.smedley.info/os2ports/ind...ld-environment

    > 2.) the project uses MMOS2. Will the emx import library os2me also work
    > with the current gcc compiler ?

    It should be possible to use these - but note that GCC 3.3.5 defaults
    to symbols having a prepended underscore - you'll need to declare the
    functions with _System to tell the linker the underscore should not be
    used.

    > 3.) I'd like to debug with VAC's debugger. Is it still possible to
    > compile with IBM compatible debug info instead of compiling with gcc's
    > native debug info (I remember some -Zomf flag) ? In other words, I want
    > to use .obj and .lib files and not .o and .a files ...

    If you link with -Zomf you can use the VAC debugger

    > 4.) The project comes with some autoconf related files etc.. Honestly, I
    > don't have the faintest idea of how to modify all these config files to
    > use different compiler flags etc. . Could someone shed some light on
    > this or point me to a good manual in the internet ?

    autoconf sucks :/ I've found no decent docs....

    Hope the above is of some help

    --
    Cheers,

    Paul.

  3. Re: Proper setup for gcc

    On Sun, 14 Sep 2008 09:13:35 UTC, "Paul Smedley"
    wrote:

    > autoconf sucks :/ I've found no decent docs....


    I heartily agree. I did find some help with a book...

    1-57870-190-2

    but it's inevitably a bit out of date as they change the autotools every
    five minutes. And I'm not sure how obtainable it is now...

  4. Re: Proper setup for gcc

    On 09/14/08 12:59 am, Lars Erdmann wrote:
    > Hallo,
    >
    > I'd like to do some modifications to a project that was developed using
    > gcc (it contains inline assembly, therefore, it's relevant).
    >
    > 1.) Can someone tell me how to properly set up gcc: what do I need ?
    > Where do I get it ? Can I use OS/2 toolkit import libs with it ?


    Paul's answer is good. Also EMX (and klibc) contains os2.h which if you
    have USE_OS2_TOOLKIT_HEADERS defined will use os2tk.h or without
    os2emx.h which approximately equals the toolkit.

    > 2.) the project uses MMOS2. Will the emx import library os2me also work
    > with the current gcc compiler ?


    I think you'd be better just using the toolkit version of MMOS2. IIRC
    the emx library was written to be compatible back when most people
    didn't have the toolkit.
    Another option is to try rebuilding os2me with klibc.

    > 3.) I'd like to debug with VAC's debugger. Is it still possible to
    > compile with IBM compatible debug info instead of compiling with gcc's
    > native debug info (I remember some -Zomf flag) ? In other words, I want
    > to use .obj and .lib files and not .o and .a files ...


    As Paul mentioned linking with -Zomf -g will allow you to use VAC's
    debugger. By default all files are .o now and it might be easier to use
    ..a libs. To use OMF libs (.lib suffix) you need to use -Zomf cflag and
    emxomfar instead of ar. The build system might need more changes as
    often they are hardwired to use .a type libs.
    Even without CFLAGS=-Zomf you should be able to mix the different types
    as long as you link with -Zomf

    > 4.) The project comes with some autoconf related files etc.. Honestly, I
    > don't have the faintest idea of how to modify all these config files to
    > use different compiler flags etc. . Could someone shed some light on
    > this or point me to a good manual in the internet ?


    ash configure --enable-debug "LDFLAGS=-Zomf" should do it. Sometimes it
    is simpler to just edit the Makefile after running configure adding
    needed flags to CFLAGS or/and LDFLAGS
    >
    > Thanks,
    > Lars


    Dave

  5. Re: Proper setup for gcc

    Paul Smedley schrieb:
    > Hi Lars,
    >
    > On Sun, 14 Sep 2008 07:59:19 UTC, Lars Erdmann
    > wrote:
    >
    >> I'd like to do some modifications to a project that was developed using
    >> gcc (it contains inline assembly, therefore, it's relevant).
    >>
    >> 1.) Can someone tell me how to properly set up gcc: what do I need ?
    >> Where do I get it ? Can I use OS/2 toolkit import libs with it ?

    > For just GCC - look at
    > ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd3.zip


    Ok, that's the compiler. But what exactly encompasses the RTL and how
    can I make use of it ? I mean, I seem to remember that the RTL is a DLL
    (gccxxx.dll ? libcxxx.dll ?) so where would I get the import library ?
    Where would I find documentation of all the RTL provided functions ? Can
    I convert the import library to OMF format so that I could use link386
    for linking ?
    Or is it possible to use GCC-3.3.5 with the old emx toolkit ?
    By the way is there a place that documents all the compiler flags and
    stuff or would I need to get the old gcc package (that came along with
    emx) and read through that ?
    I really have a problem of finding everything I need to get started with
    that compiler. It's years ago that I have used it ...
    In short: I don't understand if there exists a replacement of emx, a
    substitution for emx or something completely new.

    >
    > For a ready to use build environment, with all sorts of pre-built
    > libraries - take a look at my build environment at
    > http://www.smedley.info/os2ports/ind...ld-environment
    >
    >> 2.) the project uses MMOS2. Will the emx import library os2me also work
    >> with the current gcc compiler ?

    > It should be possible to use these - but note that GCC 3.3.5 defaults
    > to symbols having a prepended underscore - you'll need to declare the
    > functions with _System to tell the linker the underscore should not be
    > used.

    Ok, that makes sense. Obviously gcc uses cdecl as its default calling
    convention (which makes sense for a C compiler).
    As long as it uses the same name decoration for _System linkage as the
    IBM compilers and linkers I am happy with that ...
    Is there a compiler flag that will make it default to _System linkage ?

    >
    >> 3.) I'd like to debug with VAC's debugger. Is it still possible to
    >> compile with IBM compatible debug info instead of compiling with gcc's
    >> native debug info (I remember some -Zomf flag) ? In other words, I want
    >> to use .obj and .lib files and not .o and .a files ...

    > If you link with -Zomf you can use the VAC debugger
    >
    >> 4.) The project comes with some autoconf related files etc.. Honestly, I
    >> don't have the faintest idea of how to modify all these config files to
    >> use different compiler flags etc. . Could someone shed some light on
    >> this or point me to a good manual in the internet ?

    > autoconf sucks :/ I've found no decent docs....


    Yes, for a beginner it is plain hell. I want to code and not learn a new
    language and I don't have weeks to learn it.
    I take it and write myself my own makefile.

    >
    > Hope the above is of some help

    Yes it is. Thanks,

    Lars

  6. Re: Proper setup for gcc

    On 2008-09-16, Lars Erdmann wrote:
    >> ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd3.zip

    >
    > Ok, that's the compiler. But what exactly encompasses the RTL and how
    > can I make use of it ? I mean, I seem to remember that the RTL is a DLL
    > (gccxxx.dll ? libcxxx.dll ?) so where would I get the import library ?


    it's included with the compiler and gets linked automatically using
    the default compiler-switches.

    > Where would I find documentation of all the RTL provided functions ?


    I use documentation of the old emx kit, the readme and changelog
    and google for bsd/linux functions with the same name.

    > I convert the import library to OMF format so that I could use link386
    > for linking ?


    Yes, IIRC that's part of the install process for gcc335.

    > Or is it possible to use GCC-3.3.5 with the old emx toolkit ?


    I don't think so.

    > By the way is there a place that documents all the compiler flags and
    > stuff or would I need to get the old gcc package (that came along with
    > emx) and read through that ?


    gcc --help

    > I really have a problem of finding everything I need to get started with
    > that compiler. It's years ago that I have used it ...


    Don't give up, it might be easier as you think.

    > In short: I don't understand if there exists a replacement of emx, a
    > substitution for emx or something completely new.


    it's a replacement of the old emx function library. most of them
    made it into the new libc libray. Some hardware-related low level
    functions ar missing.

    >>> 4.) The project comes with some autoconf related files etc.. Honestly, I
    >>> don't have the faintest idea of how to modify all these config files to
    >>> use different compiler flags etc. . Could someone shed some light on
    >>> this or point me to a good manual in the internet ?


    You have a good chance, that 'sh configure' creates a makefile even you
    don't understand how it works. If it fails it tells you what it is looking for.
    Mostly some missing libraries you need for the project.

    BTW which project are you working on?

    If you follow Pauls sugesstion (I strongly recommend) and use his
    build-environement it should just work.

    Franz

  7. Re: Proper setup for gcc

    > BTW which project are you working on?

    I intend to update MMAUDIOPAK (MP3/FLAC/OGG IOProcs for MMOS2). While in
    general they work fine, they are lacking proper file format detection which
    leads to some issues (like the automated search for the correct IOProc to
    use on a given sound file).

    Lars



  8. Re: Proper setup for gcc

    On 2008-09-16, Lars Erdmann wrote:
    >> BTW which project are you working on?

    >
    > I intend to update MMAUDIOPAK (MP3/FLAC/OGG IOProcs for MMOS2). While in
    > general they work fine, they are lacking proper file format detection which
    > leads to some issues (like the automated search for the correct IOProc to
    > use on a given sound file).


    OK,
    I tried to compile the sources myself with gcc335 with a similar
    environement as Paul.
    In principle it compiles.
    The things I had to modify in the makefiles:
    - remove -DUSE_OS2_TOOLKIT_HEADERS
    - replace -los2me with -lMMPM2
    - replace .obj with .o
    - remove some EOF characters from some files because gcc doesn't like them.
    - add -Zomf to CFLAGS in mmioMP3\Makefile
    Perhaps this helps
    Franz

  9. Re: Proper setup for gcc

    I have similar requirements for a potential gcc support of GBM.
    Additionally I'd like to go with the base environment to keep the
    requirements as low as possible (so no huge "fits all" packages
    like Paul's env, simply because the GBM code just uses C/C++
    runtime + OS/2 API and thus doesn't need any additional libs).

    Let me quickly summarize your recommendations:

    1. Use OS2TK headers with -DUSE_OS2_TOOLKIT_HEADERS

    2. Use -Zomf for compile and link step and -g for debugging
    support with IBM VAC debugger.

    3. Use emxomfar for creating an OMF archive lib
    How do I create a DLL import lib? Can I use implib?

    So I tried a simple compile and link with the plain gcc 3.3.5 CSD3.
    The code is only using C runtime + some OS/2 API Dos calls to query
    function entry points.

    Unfortunately I get some strange error from the linker:

    [H:\GBM_SVN\rb1.61\gbm][1]gcc -o gbmver.exe -Zomf gbmveros2.c
    ILink : fatal error LNK1002: unrecognized option (ocache:0x02000000)

    Any ideas?

    The linker is ilink.exe from VAC 3.08 FP8 (I guess)
    which works pretty well with my VAC builds:

    IBM(R) Linker for OS/2(R), Version 01.08.r1a_CTC308c
    (C) Copyright IBM Corporation 1988, 1997.
    (C) Copyright Microsoft Corp. 1988, 1989.
    - Licensed Material - Program-Property of IBM - All Rights Reserved.



  10. Re: Proper setup for gcc

    > Unfortunately I get some strange error from the linker:
    >
    > [H:\GBM_SVN\rb1.61\gbm][1]gcc -o gbmver.exe -Zomf gbmveros2.c
    > ILink : fatal error LNK1002: unrecognized option (ocache:0x02000000)
    >
    > Any ideas?


    OK, I got a bit further. I grabbed ILINK 5.0 used for
    Mozilla builds and now it works.

  11. Re: Proper setup for gcc

    On 09/16/08 02:52 pm, Heiko Nitzsche wrote:
    > 3. Use emxomfar for creating an OMF archive lib
    > How do I create a DLL import lib? Can I use implib?


    Never tried with implib. You can create the import lib with emximp like so,
    emximp -o foo.lib foo.dll
    You can also link directly against the dll using -Zdll-search. See
    http://svn.netlabs.org/libc/wiki/kOptions for other klibc specific
    options including how to set up for various versions of ilink, link386
    or wlink.
    Dave

  12. Re: Proper setup for gcc

    On 09/16/08 08:15 am, Franz Bakan wrote:
    >> I convert the import library to OMF format so that I could use link386
    >> > for linking ?

    >
    > Yes, IIRC that's part of the install process for gcc335.


    IIRC you have to manually run lib/makeomflibs.cmd, see readme.

    >
    >> > Or is it possible to use GCC-3.3.5 with the old emx toolkit ?

    >
    > I don't think so.
    >
    >> > By the way is there a place that documents all the compiler flags and
    >> > stuff or would I need to get the old gcc package (that came along with
    >> > emx) and read through that ?

    >
    > gcc --help
    >


    gcc --help is somewhat broken but will display the various helps before
    crashing.
    Also look here, http://svn.netlabs.org/libc/wiki/kOptions and of course
    the old EMX docs are still somewhat applicable.
    Dave


  13. Re: Proper setup for gcc

    On Tue, 16 Sep 2008 17:50:18 +0200, Lars Erdmann wrote:

    >> BTW which project are you working on?

    >
    > I intend to update MMAUDIOPAK (MP3/FLAC/OGG IOProcs for MMOS2). While in
    > general they work fine, they are lacking proper file format detection which
    > leads to some issues (like the automated search for the correct IOProc to
    > use on a given sound file).


    I got MMIOMP3 compiling with 3.3.5 a while back. Can't remember what I
    had to change now, but you can have a copy of what I did if you like.

  14. Re: Proper setup for gcc

    > Never tried with implib. You can create the import lib with emximp like so,
    > emximp -o foo.lib foo.dll
    > You can also link directly against the dll using -Zdll-search. See
    > http://svn.netlabs.org/libc/wiki/kOptions for other klibc specific
    > options including how to set up for various versions of ilink, link386
    > or wlink.


    Thanks. I got the dll and the command line tools compiled.
    The only thing that is left I have no clue on how to resolve
    is that beside all executables also a stub with the same
    base name but no extension is created, e.g.:

    gbmver.exe -> this is the final one
    gbmver -> How do I prevent this?
    Is this the normal case?


    I use the following link options:

    gcc -Zomf -Zlinker /NOI -Zlinker /ALIGN:4 -Zlinker /EXEPACK:2
    -Zlinker /OPTFUNC -Zlinker /PACKCODE -Zlinker /PACKDATA
    -Zlinker /BASE:0x10000 -Zlinker /STACK:0x6000 -Zlinker
    /PMTYPE:VIO -Zexe -o gbmver.exe gbmveros2.o

  15. Re: Proper setup for gcc

    Never mind. I found the problem.
    It -Zexe which obviously does something else than I expected.

    > Thanks. I got the dll and the command line tools compiled.
    > The only thing that is left I have no clue on how to resolve
    > is that beside all executables also a stub with the same
    > base name but no extension is created, e.g.:
    >
    > gbmver.exe -> this is the final one
    > gbmver -> How do I prevent this?
    > Is this the normal case?
    >
    >
    > I use the following link options:
    >
    > gcc -Zomf -Zlinker /NOI -Zlinker /ALIGN:4 -Zlinker /EXEPACK:2
    > -Zlinker /OPTFUNC -Zlinker /PACKCODE -Zlinker /PACKDATA
    > -Zlinker /BASE:0x10000 -Zlinker /STACK:0x6000 -Zlinker
    > /PMTYPE:VIO -Zexe -o gbmver.exe gbmveros2.o


  16. Re: Proper setup for gcc

    On 09/16/08 07:20 pm, Heiko Nitzsche wrote:
    > Never mind. I found the problem.
    > It -Zexe which obviously does something else than I expected.


    Yes -Zexe is for makefiles that create executables without a .exe
    suffix. It creates a stub file that will run the *.exe file (or a 0 byte
    stub with plain EMX), enough to make make happy. As you found having the
    executable end in .exe is enough to create a proper executable.
    (actually I think with -Zomf it just works. Without -Zomf you end up
    with an aout file. You can run emxbind against the aout file to create
    an executable).
    Dave

  17. Re: Proper setup for gcc

    On 09/16/08 07:04 pm, Heiko Nitzsche wrote:
    >
    > I use the following link options:
    >
    > gcc -Zomf -Zlinker /NOI -Zlinker /ALIGN:4 -Zlinker /EXEPACK:2
    > -Zlinker /OPTFUNC -Zlinker /PACKCODE -Zlinker /PACKDATA
    > -Zlinker /BASE:0x10000 -Zlinker /STACK:0x6000 -Zlinker
    > /PMTYPE:VIO -Zexe -o gbmver.exe gbmveros2.o


    There are also lots of optimizing flags. You should probably be adding
    -O2 at least to your CFLAGS and LDFLAGS. Adding -Wall will turn on most
    warnings.
    Try GCC --help=* (don't mind the crash, it seems to print everything first)
    Dave
    Dave

  18. Re: Proper setup for gcc

    Paul Smedley schrieb:
    > Hi Lars,
    >
    > On Sun, 14 Sep 2008 07:59:19 UTC, Lars Erdmann
    > wrote:
    >
    >> I'd like to do some modifications to a project that was developed using
    >> gcc (it contains inline assembly, therefore, it's relevant).
    >>
    >> 1.) Can someone tell me how to properly set up gcc: what do I need ?
    >> Where do I get it ? Can I use OS/2 toolkit import libs with it ?

    > For just GCC - look at
    > ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd3.zip
    >
    > For a ready to use build environment, with all sorts of pre-built
    > libraries - take a look at my build environment at
    > http://www.smedley.info/os2ports/ind...ld-environment


    Hi,

    I got your build environment. I tweaked the batch file a little and now
    it works for me. However I have this issue:
    1.) my project asks for library "os2me". I got it from hobbes, I put it
    at the right place (file os2me.a). However, the symbols it is supposed
    to resolve are not resolved. It's included in the link step via
    "-los2me" but strangely enough the filename is os2me.a instead of
    libos2me.a (I understand that a UNIX based linker would expect that
    latter filename). If I remove this file, gcc complains that "os2me_s.a
    cannot be found". So what is going on here ?
    2.) Then I said, what the heck, I add my OS/2 toolkit library path to
    LIBRARY_PATH env var and use MMPM2.LIB instead (the better choice
    anyways). However gcc happily ignores my LIBRARY_PATH setting and tells
    me it cannot find mmpm2.lib. If I hardcode the path in the makefile, it
    works ok. I have also LIB set to point to the OS/2 toolkit library path.
    So, when I use gcc for linking, is it looking into LIBRARY_PATH, LIB or
    what ? And does it care about case sensitivity or not ? Does it care
    about foreward/backslash or not ?

    I had a look into the info file (getting info to run was another
    challenge) but I cannot see what I am doing wrong.

    Can anyone shed some light on this ?

    Lars



  19. Re: Proper setup for gcc

    Lars Erdmann schrieb:
    > Paul Smedley schrieb:
    >> Hi Lars,
    >>
    >> On Sun, 14 Sep 2008 07:59:19 UTC, Lars Erdmann
    >> wrote:
    >>
    >>> I'd like to do some modifications to a project that was developed
    >>> using gcc (it contains inline assembly, therefore, it's relevant).
    >>>
    >>> 1.) Can someone tell me how to properly set up gcc: what do I need ?
    >>> Where do I get it ? Can I use OS/2 toolkit import libs with it ?

    >> For just GCC - look at ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd3.zip
    >>
    >> For a ready to use build environment, with all sorts of pre-built
    >> libraries - take a look at my build environment at
    >> http://www.smedley.info/os2ports/ind...ld-environment

    >
    > Hi,
    >
    > I got your build environment. I tweaked the batch file a little and now
    > it works for me. However I have this issue:
    > 1.) my project asks for library "os2me". I got it from hobbes, I put it
    > at the right place (file os2me.a). However, the symbols it is supposed
    > to resolve are not resolved. It's included in the link step via
    > "-los2me" but strangely enough the filename is os2me.a instead of
    > libos2me.a (I understand that a UNIX based linker would expect that
    > latter filename). If I remove this file, gcc complains that "os2me_s.a
    > cannot be found". So what is going on here ?
    > 2.) Then I said, what the heck, I add my OS/2 toolkit library path to
    > LIBRARY_PATH env var and use MMPM2.LIB instead (the better choice
    > anyways). However gcc happily ignores my LIBRARY_PATH setting and tells
    > me it cannot find mmpm2.lib. If I hardcode the path in the makefile, it
    > works ok. I have also LIB set to point to the OS/2 toolkit library path.
    > So, when I use gcc for linking, is it looking into LIBRARY_PATH, LIB or
    > what ? And does it care about case sensitivity or not ? Does it care
    > about foreward/backslash or not ?
    >
    > I had a look into the info file (getting info to run was another
    > challenge) but I cannot see what I am doing wrong.
    >
    > Can anyone shed some light on this ?


    Never mind, I directly specified MMPM2.LIB on the linking invocation
    which was wrong, -lMMPM2 did the job. I really don't understand gcc's
    logic to figure out the correct import library name ...

    Lars

  20. Re: Proper setup for gcc

    Some answers anyways

    On 09/19/08 04:22 pm, Lars Erdmann wrote:
    > Lars Erdmann schrieb:
    >> Paul Smedley schrieb:
    >>> Hi Lars,
    >>>
    >>> On Sun, 14 Sep 2008 07:59:19 UTC, Lars Erdmann
    >>> wrote:
    >>>
    >>>> I'd like to do some modifications to a project that was developed
    >>>> using gcc (it contains inline assembly, therefore, it's relevant).
    >>>>
    >>>> 1.) Can someone tell me how to properly set up gcc: what do I need ?
    >>>> Where do I get it ? Can I use OS/2 toolkit import libs with it ?
    >>> For just GCC - look at ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd3.zip
    >>>
    >>> For a ready to use build environment, with all sorts of pre-built
    >>> libraries - take a look at my build environment at
    >>> http://www.smedley.info/os2ports/ind...ld-environment

    >>
    >> Hi,
    >>
    >> I got your build environment. I tweaked the batch file a little and
    >> now it works for me. However I have this issue:
    >> 1.) my project asks for library "os2me". I got it from hobbes, I put
    >> it at the right place (file os2me.a). However, the symbols it is
    >> supposed to resolve are not resolved. It's included in the link step
    >> via "-los2me" but strangely enough the filename is os2me.a instead of
    >> libos2me.a (I understand that a UNIX based linker would expect that
    >> latter filename). If I remove this file, gcc complains that "os2me_s.a
    >> cannot be found". So what is going on here ?


    EMX dropped the lib prefix for 8.3 compatibility. KLIBC works with both.
    Also for static, _s.a or _s.lib suffix and _dll.a or _dll.lib for import
    libraries.
    As you found you don't use the suffix when linking including the above
    examples.

    >> 2.) Then I said, what the heck, I add my OS/2 toolkit library path to
    >> LIBRARY_PATH env var and use MMPM2.LIB instead (the better choice
    >> anyways). However gcc happily ignores my LIBRARY_PATH setting and
    >> tells me it cannot find mmpm2.lib. If I hardcode the path in the
    >> makefile, it works ok. I have also LIB set to point to the OS/2
    >> toolkit library path. So, when I use gcc for linking, is it looking
    >> into LIBRARY_PATH, LIB or what ? And does it care about case
    >> sensitivity or not ? Does it care about foreward/backslash or not ?


    LIBRARY_PATH is correct with regular slashes (all gcc options use
    regular slashes). You can also use -L on the command line to tell gcc
    which directory to look in for libs, eg -Li:/os2tk45/lib -lmmpm

    >>
    >> I had a look into the info file (getting info to run was another
    >> challenge) but I cannot see what I am doing wrong.
    >>
    >> Can anyone shed some light on this ?

    >
    > Never mind, I directly specified MMPM2.LIB on the linking invocation
    > which was wrong, -lMMPM2 did the job. I really don't understand gcc's
    > logic to figure out the correct import library name ...
    >


    Basically the name without the lib prefix or any suffix including things
    like _s.lib. Previous versions also insisted on the correct type. .a for
    aout or .lib for OMF. Knut did a good job of making them work together.
    Dave
    > Lars



+ Reply to Thread
Page 1 of 2 1 2 LastLast