[aspectc-user] Problems linking

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Mon Oct 2 22:37:01 CEST 2006


Hello Marc-André,

do you compile theofile.o with a C (not C++) compiler? [This is just a
wild guess.] Did you consider the different name mangling schemes in C
and C++?

There isn't much magic behind the gnu linker. Which symbol is undefined
and where do you think should it be defined?

Olaf

Marc-André Laverdière schrieb:
> Hello,
>
> I have been jammed on this for a few days now, and I'm out of clues
> and good Google searches to make... I hope someone saw that before and
> found a solution. :)
>
> I am doing a simple test. I have a few functions in a separate .o file
> that I want to use in my aspect.
>
> ac++ -c cfile.c -a aspect.ah -p. --config ./puma.config  -o
> aspectCoutput.cc
>
> which generates what it should
>
> Then, when I do
>
> g++ -Os -pedantic theofile.o aspectCoutput.cc -o executable -lm
> -llibcrypt -llibssl -llibgnutls -llibgnutls-extra
>
> I obtain error messages that my functions that are defined in
> theofile.o have undefined references.
>
> When I run objdump on theofile.o, I get all the symbols, but all
> preceded by a '_'.
>
> Yet, that wasn't a problem when I did
> gcc -ansi -std=c99 -fno-exceptions -Os -pedantic theofile.o
> testCprogram.c -o otherexecutable -lm -llibcrypt -llibssl -llibgnutls
> -llibgnutls-extra.
>
> So, my .o file is ok, at least when compiling C code. Why is it
> non-functional when compiling C++ generated by AspectC++? How do I
> make it work
>
> P.S. Tried to compile directly with ag++ with the same results...
>
> Regards,
>




More information about the aspectc-user mailing list