News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Problem linking a dll in a console application

Started by kalxas, October 21, 2005, 03:19:56 PM

Previous topic - Next topic

kalxas

Hello everyone!

I am trying developing a console application for image processing. I use the FreeImage library which is available through a .dll file and a .lib file for linking.
In the past, when I used DevC++ (just before finding out about C::B), linking my main routine to the dll was working ok using the .lib file.
Now, after I build all my .a files (works ok with the FreeImage.dll), I try to compile my main routine for testing and I get the following message from the compiler:

C:\Program Files\msys\mingw\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lFreeImage.lib
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings

I suppose, that the linker cannot find the .lib file, but I have linked it in Project->Build options->Linker->Link Libraries...

I don't see why this is happening.
Any ideas?

Thanks
Kalxas

thomas

Apparently, you are linking against -lFreeImage.lib.

Either pass -lFreeImage.lib to the compiler via "extra options", or link against FreeImage.lib.
Linking against -lFreeImage.lib will fail because there is no such file.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

kalxas

I provide FreeImage.lib to the linker (at least that is the file I select to the compiler options window)

I just saw the advanced options button, but there isn't a list of linked libs that I can modify...

Can you please be more specific?
Thanks.

Kalxas

rickg22

Hmmm is it just me, or the new organization of the link libraries was not added in RC1?

Anyway I think there was a bug in RC1 regarding filenames. Try renaming your library to freeimage.a . That should do it :)

kalxas

I renamed the .lib file to .a but no luck...
I will download the latest cvs source and compile with it...

:)

Thanks
Kalxas