#48 Problem linking .lib files

closed-accepted
nobody
None
5
2010-10-28
2010-10-27
Anonymous
No

I'm compiling/linking using these commands:

i686-w64-mingw32-gcc.exe -Wall -g -c C:\game\main.c -o obj\Debug\main.o
i686-w64-mingw32-g++.exe -L"C:\Documents and Settings\HP_Owner\Desktop\test" -o bin\Debug\game.exe obj\Debug\main.o "OpenAL32.lib" -municode

I get this error:

i686-w64-mingw32-g++.exe: OpenAL32.lib: No such file or directory

I am sure that OpenAL32.lib exists in the folder specified in the -L option parameter. I tried OpenAL32.lib without quotes to no avail. The only way I know to get it to work is to provide the full path to OpenAL32.lib in the parameter. However, this poses a problem when, for instance, I distribute the source, as the full path will not exist on their system.

This is why it would be perfect if the -L option was compatible with .lib files. It works fine using the -l option with .a files, but the option doesn't support .lib files. I wasn't successful in converting the .lib file to an .a file using reimp. Any help is appreciated.

Discussion

  • Jonathan Yong
    Jonathan Yong
    2010-10-28

    The ld manual says to use -lOpenAL32, it will look for OpenAL32.lib in the lib path as well.

    Specifying the filename as "OpenAL32.lib" indicates that the lib file is in the current working directory.

     

  • Anonymous
    2010-10-28

    • status: open --> closed-accepted