64位的AXS3编译报/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc

编译程序时
g++ -I/usr/include/libxml2 -L/usr/lib -lxml2   xml.cpp -o xml

报错:

/usr/bin/ld: skipping incompatible /usr/lib/libxml2.so when searching for -lxml2
/usr/bin/ld: skipping incompatible /usr/lib/libxml2.a when searching for -lxml2
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc

修改编译命令为:
g++ -I/usr/include/libxml2 -L/usr/lib64 -lxml2   xml.cpp -o xml

搞定。

你可能感兴趣的:(C++,linux,xml,64位,libxml2)