cannot specify root sdk directory with syslibroot when linking

旧城冷巷雨未停 提交于 2019-12-12 04:28:34

问题


I have a few static libraries I want to link with ld. My libraries are in the directories /Users/rlt/p4/lib/ and /Users/rlt/p4/usr2/lib. I want to pass in the relative paths of these directories w.r.t /Users/rlt/p4 and use the -syslibroot to point to this directory. The documentation for ld says that this option will prepend a pre-fix to all search paths. However, the following command gives me directory not found errors for both paths I specify:

ld -syslibroot /Users/rlt/p4 -L/lib -L/usr2/lib -lA -lB -lC

This gives me could not find /lib and /usr2/lib. I tried using -Lusr2/lib and -Llib with same results. What am I missing?


回答1:


-syslibroot does not prepend its argument string to arbitrary paths. It will only add it to the paths which are consistent with the sdk directory structure.



来源:https://stackoverflow.com/questions/7216434/cannot-specify-root-sdk-directory-with-syslibroot-when-linking

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