用-fPIC选项重新编译,但是该选项已经在makefile中 [英] Recompile with -fPIC option, but the option is already in the makefile

查看:325
本文介绍了用-fPIC选项重新编译,但是该选项已经在makefile中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做的时候得到这个错误:

relocation R_X86_64_32 against `vtable for Torch::MemoryDataSet' can not be used 
when making a shared object; recompile with -fPIC

它说我应该使用-fPIC选项重新编译.我做到了,加上 CFLAGSCXXFLAGS-fPIC选项,但是我仍然遇到相同的错误.有什么办法可以解决这个问题?我已经看到此问题与一台64位计算机的使用有关,的确是我正在使用一台计算机.

解决方案

我很久以前就遇到了这个问题,如果我没记错的话,修复程序是在命令行中gcc之后移动-fPIC的位置.完全没有道理,现在已经不那么了,但是据我所知,它已经解决了.

I get this error when I do the make:

relocation R_X86_64_32 against `vtable for Torch::MemoryDataSet' can not be used 
when making a shared object; recompile with -fPIC

It says that I should recompile with the -fPIC option. I did that, adding the -fPIC option to CFLAGS and CXXFLAGS, but I still get the same error. Is there any way to solve this? I have seen that this problem is related with the use of a 64-bit machine, and it is true that I am using one.

解决方案

I had this problem quite a while back and if I remember correctly, the fix was moving the placement of -fPIC just after gcc in the command line. Made absolutely no sense, and less so now, but as I remember, that fixed it.

这篇关于用-fPIC选项重新编译,但是该选项已经在makefile中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆