English 中文(简体)
使用ANT的加密++链接器错误
原标题:Crypto++ linker error using ANT

我正试图对一位前员工为我们编写的一些自定义软件的构建过程进行逆向工程。我已经看到一切都可以编译,但我在链接过程中遇到了一个错误,这表明加密++存在问题。有线索吗?

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是Fedora 11

问题回答

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





相关问题
i want to continously run my java threads

I am running my java application where i have used threads... i am running this application using ant command on the terminal.. But when i close my terminal or press ctrl+c,then java program which was ...

Subant targets instead of ant

I m having a problem with subant and have no ideas any more. Can anyone help? Using Ant to replace some strings for other (i.e Productname and Version for "Foo" and "1.2") I used ...

java ant buildfile for project with dependencies

I am new to ant, but am trying to create an ant script that builds my current proeject with another project as a dependency. I have the ant script building my current project, but am unsure how to add ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...

Ivy, ant and start scripts

I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, ...

热门标签