跳过编译不兼容的库

跳过编译不兼容的库

本文介绍了跳过编译不兼容的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在我的本地机器上编译我的项目的副本,我得到一个错误,指出它是跳过不兼容的库。这不,当我茫然的托管服务器在工作现场版的情况下,[这让完全没有。

When I try to compile a copy of my project on my local machine, I get an error stating that it 's skipping over incompatible libraries. This isn't the case when I'm messing around with the live version hosted on the server at work [it makes perfectly there].

其他各种网站都使我相信,这可能是一个环境问题,因为我开发在Ubuntu的64位的发行,我假定服务器版本是在32位上运行。然而,我的环境变量设置为后:

Various other sites have lead me to believe that this might be an environment issue, as I'm developing on a 64-bit distro of Ubuntu and I assume the server version is running on 32-bit. Nevertheless, after setting my environment variables to:

CFLAGS+=" -m32"
CXXFLAGS+=" -m32"

我仍然收到相同的编译错误:

I still receive the same compile error of:

/usr/bin/ld: skipping incompatible /dvlpmnt/libPI-Http.a when searching for -lPI-Http

能否HAZ教程?

Can haz tutorial?

== 修改 ==

这是我收到的输出时,我也跟着乔纳森的建议是:

This was the output I recieved when I followed Jonathan's advice:

http.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped

显然,有问题的库是32位的毕竟?

Apparently, the library in question is 32-bit after all?

推荐答案

该消息实际上不是一个错误 - 这只是一个警告,有问题的文件是不正确的架构(如32位VS 64位,错误的CPU架构)。连接器将继续寻找合适的类型库。

That message isn't actually an error - it's just a warning that the file in question isn't of the right architecture (e.g. 32-bit vs 64-bit, wrong CPU architecture). The linker will keep looking for a library of the right type.

当然,如果你还得到一个错误沿着的行无法找到LPI-HTTP 那么你有一个问题: - )

Of course, if you're also getting an error along the lines of can't find lPI-Http then you have a problem :-)

这是很难提出什么具体的补偿措施将不知道你的编译系统和生成文件的细节,但这里是一个在黑暗中夫妇的镜头:

It's hard to suggest what the exact remedy will be without knowing the details of your build system and makefiles, but here are a couple of shots in the dark:

  1. 只是为了检查:通常你想补充标志 CFLAGS 而不是 CTAGS - 你确定这是正确? (你有什么可能是正确的 - 这将取决于你的编译系统)
  2. 在通常情况下,需要将该标志传递给链接过 - 所以您可能还需要修改 LDFLAGS
  1. Just to check: usually you would addflags to CFLAGS rather thanCTAGS - are you sure this iscorrect? (What you have may be correct - this will depend on your build system!)
  2. Often the flag needs to be passed to the linker too - so you may also need to modify LDFLAGS

如果不帮助 - 你能发布完整的错误输出,加上实际的命令(例如的gcc foo.c的-m32 -Dxxx 等),这是被执行?

If that doesn't help - can you post the full error output, plus the actual command (e.g. gcc foo.c -m32 -Dxxx etc) that was being executed?

这篇关于跳过编译不兼容的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 15:50