PDA

View Full Version : qt Cross compile errors: libQtGui.so:undefined reference to`q_atomic_decrement'



balarkalpesh
9th April 2009, 07:12
Hi,
I am cross compiling qt-all-opensource-src-4.5.0 for arm board (Davinci) with following configure options.
./configure -qvfb
export CC=/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-gcc
export CXX=/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-g++
./configure -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-arm-g++ -qvfb -little-endian -host-little-endian -webkit
gmake
while make i got following errors.

/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/Qt-4.5.0/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.5.0/lib -o screenshot .obj/release-shared/main.o .obj/release-shared/screenshot.o .obj/release-shared/moc_screenshot.o -L/home/ugawande/qt/qt-all-opensource-src-4.5.0/lib -lQtCore -lQtGui -L/home/ugawande/qt/qt-all-opensource-src-4.5.0/lib -lQtNetwork -lm -ldl -lpthread -lX11 -lrt
.obj/release-shared/screenshot.o(.text+0xb0): In function `Screenshot::saveScreenshot()':
screenshot.cpp: undefined reference to `q_atomic_increment'
.obj/release-shared/screenshot.o(.text+0xd0):screenshot.cpp: undefined reference to `q_atomic_increment'
.obj/release-shared/screenshot.o(.text+0xe4):screenshot.cpp: undefined reference to `q_atomic_decrement'
.obj/release-shared/screenshot.o(.text+0xfc):screenshot.cpp: undefined reference to `q_atomic_decrement'
.obj/release-shared/screenshot.o(.text+0x114):screenshot.cpp: undefined reference to `q_atomic_decrement'
.obj/release-shared/screenshot.o(.text+0x1dc):screenshot.cpp: undefined reference to `q_atomic_decrement'
.obj/release-shared/screenshot.o(.text+0x1f4):screenshot.cpp: undefined reference to `q_atomic_decrement'
.obj/release-shared/screenshot.o(.text+0x20c):screenshot.cpp: more undefined references to `q_atomic_decrement' follow
/home/ugawande/qt/qt-all-opensource-src-4.5.0/lib/libQtCore.so: undefined reference to `q_atomic_fetch_and_add_int'
/home/ugawande/qt/qt-all-opensource-src-4.5.0/lib/libQtCore.so: undefined reference to `q_atomic_test_and_set_int'
/home/ugawande/qt/qt-all-opensource-src-4.5.0/lib/libQtCore.so: undefined reference to `q_atomic_test_and_set_ptr'
collect2: ld returned 1 exit status
make[3]: *** [screenshot] Error 1
make[3]: Leaving directory `/home/ugawande/qt/qt-all-opensource-src-4.5.0/examples/desktop/screenshot'
make[2]: *** [sub-screenshot-make_default-ordered] Error 2
make[2]: Leaving directory `/home/ugawande/qt/qt-all-opensource-src-4.5.0/examples/desktop'
make[1]: *** [sub-desktop-make_default] Error 2
make[1]: Leaving directory `/home/ugawande/qt/qt-all-opensource-src-4.5.0/examples'
make: *** [sub-examples-make_default-ordered] Error 2
I have tried adding above undefined functions as dummy functions in qt-all-opensource-src-4.5.0/src/corelib/thread/qatomic.cpp file and recompile source but it gives same errors.

What could be the reson for these errors.
Thanks in advance.

Kalpesh Balar