Re: The order of arguments differs

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

 



20.2.2012 10:31, spam.spam.spam.spam@xxxxxxx kirjoitti:

First computer :
gcc -Wall -Wextra `xml2-config --cflags` -g -O2 `xml2-config --libs`  -o xmlparsefile xmlparsefile-main.o
make[1]: Leaving directory `/.../1-xmlParseFile/src'
make[1]: Entering directory `/.../1-xmlParseFile'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/.../1-xmlParseFile

Second computer :
gcc -Wall -Wextra `xml2-config --cflags` -g -O2 `xml2-config --libs`  -o xmlparsefile xmlparsefile-main.o
xmlparsefile-main.o: In function `parseDoc':
main.c:(.text+0xd): undefined reference to `xmlParseFile'
main.c:(.text+0x51): undefined reference to `xmlParseFile'
main.c:(.text+0x63): undefined reference to `xmlParseFile'
main.c:(.text+0x68): undefined reference to `xmlParseFile'
collect2: ld returned 1 exist status

Do you understand why I got this error on one computer, and not on the other?

Too complicated... You should simply look what the command :

gcc -Wall -Wextra `xml2-config --cflags` -g -O2 `xml2-config --libs` \
-o xmlparsefile xmlparsefile-main.o

causes during the link phase. The '-v' option for GCC and '-verbose'
for the linker ('-Wl,-verbose' for GCC) are good tools for this. Just
add them somehow to the process or try the command manually with the
additions :

gcc -v -Wall -Wextra `xml2-config --cflags` -g -O2 \
`xml2-config --libs` -o xmlparsefile xmlparsefile-main.o

gcc -Wl,-verbose -Wall -Wextra `xml2-config --cflags` -g -O2 \
`xml2-config --libs` -o xmlparsefile xmlparsefile-main.o


[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