且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在编译时跳过不兼容的库

更新时间:2022-02-16 04:01:36

该消息实际上并不是错误 - 它只是警告所涉及的文件的架构不正确(例如 32 位与 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.

当然,如果你也遇到了 can't find 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 :-)

在不知道构建系统和 makefile 的详细信息的情况下,很难提出确切的补救措施,但这里有一些黑暗中的镜头:

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 add flags to CFLAGS rather than CTAGS - are you sure this is correct? (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?