开发者

MingW: cannot find -lpthreadGC2

开发者 https://www.devze.com 2023-03-24 19:08 出处:网络
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

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号