开发者

Error compiling Qualnet on Mac: file is not of required architecture

开发者 https://www.devze.com 2023-01-09 14:41 出处:网络
When trying to compile Qualnet on Mac, I got the following error: ld: warning: in ../kerne开发者_StackOverflowl/obj/mobility_private.o-darwin-x86-gcc-4.0, file is not of required architecture

When trying to compile Qualnet on Mac, I got the following error: ld: warning: in ../kerne开发者_StackOverflowl/obj/mobility_private.o-darwin-x86-gcc-4.0, file is not of required architecture and a bunch of errors for other files in this kind. So I'm wondering if there is anyway to solve the problem. Anxious waiting for help.


It means you're trying to link objects of different architecture.

For example, having an object compiled for i386 (32 bits) and another compiled for x86_64 (64 bits).

Make sure all objects are compiled for the targeted architecture(s). Your options are:

  1. Recompile mobility_private.o for 64 bits (-arch x86_64);
  2. Recompile mobility_private.o for both 32 and 64 bits (-arch i386 -arch x86_64);
  3. Recompile your application for 32 bits (-arch i386), so it correctly links against mobility_private.o.


You can check the architecture of a certain binary with file:

file libdynlib.so
libdynlib.so: Mach-O 64-bit dynamically linked shared library x86_64

You must compile your program to the same architecture of the libraries you are using. So, everything must be 32 bits or 64 bits.

0

精彩评论

暂无评论...
验证码 换一张
取 消