You are on an x86_64 platform, I presume CentOS is compliant and is multilib. Not being familiar CentOS, I can't be 100%. The linker is finding the 32-bit version of the particular library, but wants the 64-bit version. Since the examples build and execute, the linker is ultimately finding the 64-bit version. If it couldn't find the 64-bit library, the build would fail.
On a compliant x86_64 system the 32-bit libraries will live in */lib and the 64-bit in */lib64. You can define a set of env var for 32- and 64-bit in one of your configuration files. Then you can pass these appropriately when you build for the respective ABI. For example:
Code:
export PKG_CONFIG_PATH32="/usr/lib/pkgconfig"
export PKG_CONFIG_PATH64="/usr/lib64/pkgconfig"
export XORG_PREFIX=/usr
export PATH="${PATH}:${XORG_PREFIX}/bin"
export PKG_CONFIG_PATH32="${PKG_CONFIG_PATH32}${PKG_CONFIG_PATH32+:}${XORG_PREFIX}/lib/pkgconfig"
export PKG_CONFIG_PATH64="${PKG_CONFIG_PATH64}${PKG_CONFIG_PATH64+:}${XORG_PREFIX}/lib64/pkgconfig"
export BUILD32="-m32 -pipe -O2 -mtune=athlon64"
export BUILD64="-m64 -pipe -O2 -mtune=athlon64"
export LD_BUILD32="-m elf_i386"
export LD_BUILD64="-m elf_x86_64"
Then you could configure for 64-bit thusly
Code:
CC="gcc ${BUILD64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
./configure --prefix=/usr --libdir=/usr/lib64