linux中的C#-perlembed-compile错误

linux中的C#-perlembed-compile错误,c#,c,linux,perl,C#,C,Linux,Perl,我想问你一个关于perlembed的问题。关于以下问题的最后一项: 我问过jonathanpeppers,但他说他不再使用perl和c了。因此,我向小组成员提问 我试图在linux机器上运行perlembed.c,但出现以下错误。你能帮我吗 [root@BSG01 melih]# gcc -shared -Wl,-soname,perlembed.so -o perlembed.so perlembed.c `perl -MExtUtils::Embed -e ccopts -e ldopts

我想问你一个关于perlembed的问题。关于以下问题的最后一项:

我问过jonathanpeppers,但他说他不再使用perl和c了。因此,我向小组成员提问

我试图在linux机器上运行perlembed.c,但出现以下错误。你能帮我吗

[root@BSG01 melih]# gcc -shared -Wl,-soname,perlembed.so -o perlembed.so perlembed.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
/usr/bin/ld: /tmp/ccRP7CYZ.o: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/tmp/ccRP7CYZ.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

只需按照错误消息中的建议执行即可。使用编译器选项
-fPIC

gcc -shared -Wl,-soname,perlembed.so -o perlembed.so -fPIC perlembed.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
编辑: