gcc编译共享库的错误问题
根据网上的文章,编写了一些cpp文件,编译:
$ g++ -fPIC -c *.cpp
$ gcc -shared -Wl,-soname,libmytest.so.1 -o libmytest.so.1.0 *.o
$ ln -s libmytest.so.1.0 libmytest.so.1
$ ln -s libmytest.so.1 libmytest.so
执行到第2步的时候,提示:
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file libfoo.so.1: open failed: No such file or directory
ld: fatal: File processing errors. No output written to libfoo.so.1.0
collect2: ld returned 1 exit status
谢谢