编译TOP-SURF时遇到的问题(ubuntu,64位)

1. If you get an error  './topsurf/zlib/compress.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC',

    which as far as we known only occurs when you are building a 64-bit library, then you need to add '-fPIC' to each of the 'Command' lines in the C++ Linker, C++ Compiler, and C Compiler settings for both the 'Debug' and the 'Release' configurations. The C++ Linker and C++ Compiler command lines will then look like 'g++ -fPIC', whereas the C Compiler command line will look like 'gcc -fPIC'.

解决步骤:

(1)Select the TOP-SURF project in the left pane, and right-click to show the context menu, from which you will select 'Properties'. 

(2)This opens a new window. In the left pane of this window, expand the 'C/C++ Build' option and then click 'Settings'.

(3) 在界面左侧分别选择C++ Linker, C++ Compiler, and C Compiler (如下图),在command中加入-fPIC

(4)在界面上方Configuraion处选择release重复(3)的步骤


2.#include<io.h>, io.h: No such file or directory

换成#include<sys/io.h>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值