Static library symbols not being found even with -l

无人久伴 提交于 2019-12-06 16:45:34

gcc is sensitive to the order of libraries. When it's compiling liborc-0.4.a in, there is no need for orc_init, so it's not included. The solution is to put the LDFLAGS at the end of the command:

gcc -o output input.o -lschroedinger-1.0 -lorc-0.4

You most probably compiled libschroedinger with shared liborc. Static library is the same as bunch of object files in an archive, so they don't need to see more than headers. Write like the following to be sure (the same apples to liborc).

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