0

I get this error when compiling:

ld: warning: ignoring file /Users/matt/Programming/BitEagle_Projects/cbitcoin/build/obj/CBNetworkFunctions.o, file was built for unsupported file format ( 0x7f 0x45 0x4c 0x46 0x 2 0x 1 0x 1 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Users/matt/Programming/BitEagle_Projects/cbitcoin/build/obj/CBNetworkFunctions.o

And for every other object file when compiling object files with:

gcc -c -O2 -Wall -Wno-overflow -pedantic -std=c99 -I/Path/To/Headers -m64 -o objFile.o srcFile.c

I try to link the files using:

gcc -dynamiclib -Wl -flat_namespace -undefined dynamic_lookup -o libwhatever objFile1.o objFile2.o

So what is causing this problem?

The gcc version is: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Thank you.

Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122

1 Answers1

2

The header information in the first error message indicates that CBNetworkFunctions.o is an ELF (probably Linux) object file, not an OS X Mach-O object file.

If this object file is not being created by your build process, you will need to remove it and replace it with one built by the Mac OS X toolchain.

If it is being created by your build process, something very odd is going on, and you will need to give us some more details on what you're doing.

  • Thanks. I made this question too quick since I just realised that the object files were not being compiled and the old copies from Linux were being linking instead. I fixed the clean option which forced a compile and it works. – Matthew Mitchell Sep 03 '12 at 23:12