[CMake] CMake adds "lib" prefix to library. Bug?

Rolf Eike Beer eike at sf-mail.de
Tue Nov 23 08:17:31 EST 2010


> Hi list.
>
> Not sure if this is a bug or something stupid I've done. On several
> Windows build environments (two XP, two 7, this happens with 2.8.2 and
> 2.8.3), I'm getting the error:
>
> c:/compilers/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe:
> cannot find -llibodbc32
>
> That's clear enough. It's also clear what the problem is: there is no
> liblibodbc32.a in my environment. There is however a libodbc32.a, which
> I would expect it to pick up.
>
> With VERBOSE=1, make gives me a long g++ command ending with:
>
> ... -Wl,-Bstatic -llibodbc32 -Wl,-Bdynamic -lkernel32 -luser32 -lgdi32
> -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
>
> Which is correct apart from the -llibodbc32 part. (I'm not entirely
> clear on why CMake felt it necessary to specify that it's a static lib
> when it didn't with the previous ones.)
>
> I've debugged my FindODBC.cmake with "message(STATUS ${blah})"
> instructions and it returns "odbc32", which is correct.
>
> So my question is: why is CMake adding an extra "lib"? I can work
> around it for now, but I'd like to solve this one properly.

http://public.kitware.com/Bug/view.php?id=11468

Eike


More information about the CMake mailing list