The errors you see mean that the assembly has a mixture of i386 and x86_64 code, and you need to be consistent. If you have no good reason (otherwise I would be interested to know what it is), you should compile everything only for 64-bit. Using gcc on a Mac is usually the default, but you can force it to add the -m64 flag to compilation. One way to do this is to set CC="gcc -m64" on the make command line; There are other ways to improve, but the details depend on your makefile content.
To solve: first, delete all the libraries and object code that you created in your project area (perhaps make clean will do this - if you wrote a clean goal). Then set the CC value or its flags ( CFLAGS ultimately, but the way CFLAGS built depends on the makefile ) to ensure 64-bit compilation is performed. Then make sure you use this in all compilations. If you do not see -m64 , you have a problem.
If you must use 32-bit, replace -m32 with -m64 .
The discussion above assumes that you are using gcc to run the ld command. If you do not, you will use it yourself until you use gcc to run the ld command. In my opinion, you have better things to do with your life than working on how to run the ld command correctly; Of course I have.
source share