Re: The order of arguments differs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12-02-15 09:41 AM, spam.spam.spam.spam@xxxxxxx wrote:
Hello,

I am compiling a program on 2 computers.

Table of contents
1. First computer
2. Second computer
3. Conclusion

1. First computer

$ gcc src/main.c `xml2-config --libs` `xml2-config --cflags`

Now with a different order of arguments :
$ gcc `xml2-config --libs` `xml2-config --cflags` src/main.c
/tmp/ccXlXfPu.o: In function `parseDoc':

3. Conclusion

It's a big problem to have a different behaviour on each computer.

You're likely linking statically against libxml2 on the first computer, and dynamically on the second. Check with -Wl,-t. Link order matters when statically linking; the reference always has to come before the symbol definition (unless you use -start-group/--end-group to have ld make a second pass)

Do you think it's a gcc problem?

No.

Regards,

Ryan Mansfield



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux