Bug #14529 2008-09-21 05:16

geister

Truncating 'lib' before linking may cause problems.

Platform: Windows (should be present on other platforms)

Version: 8.02 (SVN Revision: 5208)

Reproducible: Yes

Severity: Minor (but can cause headaches until you figure it out)

This is easily reproducible on Windows using Speex. Just add "libspeex" (along with the correct paths, so it knows where to find it) to your project, and try to build. It will refuse to link as it will look for "speex", when the correct name is "libspeex". To fix this, link to "liblibspeex", which will become "libspeex".

Speex version used: Windows binaries 1.2beta3

http://downloads.xiph.org/releases/speex/speex-1.2beta3-win32.zip

Found the code that is in charge of doing that in "plugins/compilergcc/makefilegenerator.cpp" on line 405 in function "void MakefileGenerator::DoAppendLinkerLibs(wxString& cmd, ProjectBuildTarget* target, bool useGlobalOptions)".

I also found the same behavior in "sdk/compilercommandgenerator.cpp" on line 748 in function "wxString CompilerCommandGenerator::FixupLinkLibraries(Compiler* compiler, const wxString& lib)", which seems to be the same code.

The fix is actually to check "chkLinkerNeedsLibPrefix", but this is located in advanced compiler options and may not be accessible to all users (there isn't a warning dialog for no reason). So I am suggesting to make this option more accessible to users, or even enabled by default on Windows, so we can keep those "lib" in the library names.

If I want to link to "something", I won't write "libsomething". This may accelerate cross-platform porting of code, but it causes problems on Windows, and it should be up to the programmer to decide whether or not to remove the "lib" from the library name.

Category
Application::WrongBehaviour
Group
 
Status
Closed
Close date
2008-09-21 11:00
Assigned to
mortenmacfly