Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在linux用户空间中创建*.a到*.so?_Linux_Gcc_G++_Userspace - Fatal编程技术网

如何在linux用户空间中创建*.a到*.so?

如何在linux用户空间中创建*.a到*.so?,linux,gcc,g++,userspace,Linux,Gcc,G++,Userspace,我编译了文件makefile.am,我需要我的lib的共享链接,例如编译后我看到/usr/lib64/libtest.a,但我需要libtest.so,因为我需要我的lib到其他C源文件 示例:g++-llibtest test.c 我读过这篇文章,但我不知道如何工作以及如何使用ranlib或ar,有没有办法创建*.a到*.so?我用 ./configure --disable-shared 尝试使用g++-l:libtest.a test.c或g++/usr/lib64/libtest.a

我编译了文件makefile.am,我需要我的lib的共享链接,例如编译后我看到
/usr/lib64/libtest.a
,但我需要
libtest.so
,因为我需要我的lib到其他C源文件

示例:
g++-llibtest test.c


我读过这篇文章,但我不知道如何工作以及如何使用
ranlib
ar
,有没有办法创建*.a到*.so?

我用

./configure --disable-shared

尝试使用
g++-l:libtest.a test.c
g++/usr/lib64/libtest.a test.c
链接到静态库。a test.c不起作用,我有
未定义的引用