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.
Thanks,
Adam J Richardson
====================
CMakeLists.txt snippet:
if (ODBC_FOUND)
set(T_LIBS ${T_LIBS} ${ODBC_LIBRARIES})
# message(STATUS "ODBC: ${ODBC_LIBRARIES}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_ODBC=1")
message(STATUS "ODBC not found, omitting from build.")
endif()
FindODBC.cmake sans comments:
SET( ODBC_FOUND 0 )
FIND_PATH(ODBC_INCLUDE_DIRECTORIES sql.h
DOC "Specify the directory containing sql.h."
)
FIND_LIBRARY( ODBC_LIBRARIES
NAMES iodbc odbc odbcinst odbc32
DOC "Specify the ODBC driver manager library here."
)
IF (ODBC_LIBRARIES)
IF (ODBC_INCLUDE_DIRECTORIES)
SET( ODBC_FOUND 1 )
ENDIF (ODBC_INCLUDE_DIRECTORIES)
ENDIF (ODBC_LIBRARIES)
MARK_AS_ADVANCED( ODBC_FOUND ODBC_LIBRARY ODBC_LIBRARIES ODBC_EXTRA_LIBRARIES
ODBC_INCLUDE_DIRECTORIES )
signature.asc
Description: PGP signature
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
