问题
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