Communication error with Mac OSX 10.6.7

I see:

ld: in objs/AttributeValueTest.o, can't link with a main executable for architecture x86_64

When creating a very simple program that has only 1.h and 1.cpp file.

Compiled strings:

g++ -g -I./ -I/usr/local/include -o objs/AttributeValueTest.o tp_datastruct/tests/AttributeValueTest.cpp -L/usr/local/lib -lavrocpp -lcppunit -lm 
g++ -g -I./ -I/usr/local/include -o AttributeValueTest objs/AttributeValueTest.o -L/usr/local/lib -lavrocpp -lcppunit -lm 

I tried to specify -arch x86_64, -arch i386 and -m32, but nothing worked (I got other errors, he complained that libcppunit was not in the correct format).

Any idea / pointer / suggestion?

Thank!


Very strange. I dug a little and saw that AttributeValueTest.o could already be executable. I made a “file” on this AttributeValueTest.o and, of course, this is a ready-to-execute executable file. I changed my makefile to rename this .o to AttributeValueTest and I can happily run it. In addition, the executable comes with the ".dSYM" directory, which I can delete without any problems ... I do not understand what is happening, but now I can run the executable ...

+3
source share
1 answer

-c g++ . . , . gcc:

-c , . . .

r > .c,.i,.s .. .o. , , .

+6

All Articles