tags:

views:

35

answers:

2

When trying to compile Qualnet on Mac, I got the following error: ld: warning: in ../kernel/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.

A: 

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.
jweyrich
A: 

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.

karlphillip