[CMake] Problems with linking on MinGW?

Jesse Perla jesseperla at gmail.com
Tue Jun 15 12:25:20 EDT 2010


On Tue, Jun 15, 2010 at 12:01 PM, Hendrik Sattler
<post at hendrik-sattler.de>wrote:

> Your library name is NOT "libetk-mgw45". Try "etk-mgw45" instead and read
> about library file names.
>
Thanks for your help.  Alas, on MSVC10 and Intel11.1 windows, the
"link_directories" and "target_link_libraries" approach I used above (with
the full filename) worked fine and hence never tried other methods

I had tried the "etk-mgw45" without the "lib" and it didn't seem to work.

Also, do not use link_directories() but use find_library() and the value you
> get from it.


I have tried a few permutations with find_library, but not having a lot of
luck.  Here is the current section of code I am testing with.

  link_directories( "c:/working/etk_binaries")
  find_library(LIB_NAME "etk-mgw45-d" "c:/working/etk_binaries")
  message("Value of LIB_NAME ${LIB_NAME}")
  if(${LIB_NAME} STREQUAL "LIB_NAME-NOTFOUND")
   MESSAGE("FAILED TO FIND LIBRARY!!!!!!!!!!!!!!!!!!!")
  endif(${LIB_NAME} STREQUAL "LIB_NAME-NOTFOUND")

I have c:\working\etk_binaries in my windows path, I have tried putting the
libetk-mgw45-d.a inside of the directory with the CMakeLists.txt/test.cpp.
 And tried a few variations of find_library such as:
find_library(LIB_NAME NAME etk-mgw45-d PATHS "c:/working/etk_binaries"
PATH_SUFFIXES "a")

But I always get the NOTFOUND.

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100615/bc2cedeb/attachment.htm>


More information about the CMake mailing list