Re: The order of arguments differs

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

 



I have just compiled libxml2 the same way on the two computers :
./configure --prefix=...
make
make install

On the first computer, I got the compile problem.
On the second computer, I got no problem when compile.

So, I think the problem is about gcc on the first computer.

What should I do to compile fine my program with gcc on both computers?

----- Mail original -----
De: "Ryan Mansfield" <rmansfield@xxxxxxx>
À: gcc-help@xxxxxxxxxxx
Envoyé: Mercredi 15 Février 2012 15:49:04
Objet: Re: The order of arguments differs

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