Link a shared library with g++

旧巷老猫 提交于 2019-12-25 01:54:39

问题


I've got a cpp file a.cpp and a shared object libA.so it's gonna use under the same folder, however, when I tried to use g++ to link them together, it declares that it cannot find the library (I checked with ldd afterwards).

This is the command I used g++ a.cpp -I . -L. -lA

Any idea how this might be solved?

Possible duplicates: building and linking a shared library


回答1:


use g++ -o a a.cpp -I . -L. your-so-name.so



来源:https://stackoverflow.com/questions/47967646/link-a-shared-library-with-g

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