Set CMake to use dyld options instead GNU ld options under OS X

旧时模样 提交于 2019-12-23 02:42:28

问题


I try to to port a linux software to OS X (Yosemite) which uses CMake to be built. The only modification that I necessarily made, was to direct to the Homebrew installed GNU GCC and G++ when executing cmake.

If I use the already existing CMakeLists.txt, the build process stops with the following error:

ld: unknown option: --start-group
collect2: error: ld returned 1 exit status
make[2]: *** [lib/somelib.dylib] Error 1
make[1]: *** [lib/somelib.dir/all] Error 2
make: *** [all] Error 2

Obviously --start-group is an option only for GNU ld and not dyld, the OS X ld derivate. Installing GNU ld on OS X is not possible, as answered here.

How can set CMake to use dyld options instead?

来源:https://stackoverflow.com/questions/31588546/set-cmake-to-use-dyld-options-instead-gnu-ld-options-under-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!