Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.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
加密++;使用ANT时发生链接器错误_Ant_Fedora_Linker Errors_Crypto++_Fedora11 - Fatal编程技术网

加密++;使用ANT时发生链接器错误

加密++;使用ANT时发生链接器错误,ant,fedora,linker-errors,crypto++,fedora11,Ant,Fedora,Linker Errors,Crypto++,Fedora11,我正试图对前一位员工为我们编写的一些定制软件的构建过程进行逆向工程。我已经看到所有的东西都可以编译了,但是我在链接过程中遇到了一个错误,它指向了crypto++的一个问题。有什么线索吗 compile.util: compile: [echo] Compiling: util [cc] Starting dependency analysis for 55 files. [cc] 55 files are up to date. [cc] 0

我正试图对前一位员工为我们编写的一些定制软件的构建过程进行逆向工程。我已经看到所有的东西都可以编译了,但是我在链接过程中遇到了一个错误,它指向了crypto++的一个问题。有什么线索吗

compile.util:

compile:
     [echo] Compiling: util
       [cc] Starting dependency analysis for 55 files.
       [cc] 55 files are up to date.
       [cc] 0 files to be recompiled from dependency analysis.
       [cc] 0 total files to be compiled.

link.util:

link:
     [echo] Linking shared library: libutil
       [cc] 0 total files to be compiled.
       [cc] Starting link
       [cc] /usr/bin/ld: /home/john/softwarename/thirdparty/crypto/5.6.1_64/libcryptopp.a(cryptlib.o): relocation R_X86_64_32 against `CryptoPP::DEFAULT_CHANNEL' can not be used when making a shared object; recompile with -fPIC
       [cc] /home/john/softwarename/thirdparty/crypto/5.6.1_64/libcryptopp.a: could not read symbols: Bad value
       [cc] collect2: ld returned 1 exit status

BUILD FAILED
/home/john/softwarename/build/build.xml:167: Following error occured while executing this line
/home/john/softwarename/build/link.xml:27: gcc failed with return code 1

Os is Fedora 11

您链接到共享库中的每个对象文件都必须是位置独立的,这意味着加载程序可以将其移动到内存中任何需要的位置,并且仍然可以工作。您的加密库没有以这种方式编译,因此在编译标志中添加了使用
-fPIC
重新编译的警告。或者,您可以将libutil设置为静态库,而不是共享库。如果没有关于构建文件的更多详细信息,我无法提供有关如何执行或选择哪一个的更多详细信息。

链接到共享库中的每个对象文件都必须是位置独立的,这意味着加载程序可以将其移动到内存中任何需要的位置,并且仍然可以工作。您的加密库没有以这种方式编译,因此在编译标志中添加了使用
-fPIC
重新编译的警告。或者,您可以将libutil设置为静态库,而不是共享库。如果没有关于构建文件的更多详细信息,我无法提供关于如何执行或选择哪一个的更多详细信息。

进一步调查后,我认为我的ANT构建文件在我的加密目录中需要一个
libcryptopp.so
。但是在下载crypto++源代码并运行
make
之后,它会创建一组.o文件和一个libcryptopp.a文件。如何获取所需的libcryptopp.so文件?我是GCC和ANT的新手,如果这听起来像是一个noob编译问题,我很抱歉。在crypto目录内的makefile中,将
-fPIC
添加到
cxflags
的末尾,然后执行
清除
并重试。进一步调查后,我想我的ANT构建文件在我的加密目录中需要一个
libcryptopp.so
。但是在下载crypto++源代码并运行
make
之后,它会创建一组.o文件和一个libcryptopp.a文件。如何获取所需的libcryptopp.so文件?我是GCC和ANT的新手,如果这听起来像是一个noob编译问题,我很抱歉。在crypto目录内的makefile中,将
-fPIC
添加到
cxflags
的末尾,然后执行
清除
并重试。