MingW: cannot find -lpthreadGC2
I get the error
开发者_运维技巧cannot find -lpthreadGC2
when building my program. The strange thing is that it is definitly there. I build using cmake, in combinition with Eclipse and MingW. All other libraries work perfectly fine (they are set up in the same way).
With cmake I can use the command message()
to give out messages. I checked that all include paths and lib pathes are set correctly with message(). I can confirm this in the Eclipse project settings, the paths are set (including pthreads.h works perfectly, it is found).
The command target_link_libraries(MyApp "libpthreadGC2.a")
is also executed (checked again with message()
).
Summary: all pathes are set, all linking is ordered to cmake. Eclipse knows all the paths. But the MingW linker doesn't find the library. Any ideas where I should look for the errors?
Ah, just found it out...
The cmake command add_executable()
has to come after the link_directories()
call... But I still wonder, why this only was for the pthreads lib and not for the others...
精彩评论