I have read many solutions, an have tried many.. but they all end up with dependancies in the executable in Linux. I did mange to do this however in Windows and got it working and could check the exe with depend.exe
1. I build a static QT build with the following
Qt Code:
  1. ./configure -prefix /usr/local/Trolltech/Qt-4.8.5_static -static -qt3support -plugin-sql-mysql -release -nomake demos -nomake examples -nomake tools -qt-zlib -qt-libpng -qt-libmng -qt-libjpeg -qt-libtiff -no-webkit
To copy to clipboard, switch view to plain text mode 
2. I then ran gmake, (wait a few hous) and then gmake install as root, and as expected I have a new build at /usr/local/Troltech/Qt4.8.5_static
3. I then add the following to the pro file
Qt Code:
  1. CONFIG += release
  2. unix {
  3. MOC_DIR = .moc
  4. OBJECTS_DIR = .obj
  5. DEFINES += _LINUX_
  6. CONFIG(release){
  7. TARGET = release/comms_spy # debug_binary
  8. } else {
  9. TARGET = debug/comms_spy # release_binary
  10. }
  11. CONFIG += static
  12. }
  13. }
  14. RESOURCES += images.qrc
  15. static {
  16. CONFIG += static
  17. DEFINES += STATIC
  18. message("Static build.")
  19. LFLAGS = -static-libgcc
  20. }
To copy to clipboard, switch view to plain text mode 
If I build this now in QTCreator (Added the new QT version and changed it in the kit), it uses the correct path for the static build, for example an extraction of the build show
Qt Code:
  1. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -D_QT_ -DDLMS -DFLIR -DGSSII -DIDS816 -DMEA -DMETRO -DMIT -DMP3 -DONCE -DPTP -DSECURITY -DXNCORP -D_LINUX_ -DSTATIC -D_LINUX_ -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/local/Trolltech/Qt-4.8.5_static/mkspecs/linux-g++ -I. -I/usr/local/Trolltech /Qt-4.8.5_static/include/QtCore -I/usr/local/Trolltech/Qt-4.8.5_static/include/QtGui -I/usr/local/Trolltech/Qt-4.8.5_static/include -I.moc -I. -o .obj/comms_spy.o 2
  2. comms_spy.cpp)
  3. etc
To copy to clipboard, switch view to plain text mode 
4. The file size increase from 500K to approx 16Meg, and the message "Static build." is displayed during the build phase,
This look promising but if I use LDD , or a script file downloaded I get this ( the Qt dependencies are gone BUT )
Qt Code:
  1. gerrie@linux-bk94:~/worksheet/creatron/comms_spy/release> ldd comms_spy
  2. linux-vdso.so.1 (0x00007fff8dfb7000)
  3. libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007fc966fda000)
  4. libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007fc966dd2000)
  5. libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007fc966bb6000)
  6. libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007fc9669ac000)
  7. libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007fc96676f000)
  8. libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fc9664dd000)
  9. libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fc9662cb000)
  10. libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fc965f8d000)
  11. libdl.so.2 => /lib64/libdl.so.2 (0x00007fc965d89000)
  12. libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007fc965b87000)
  13. libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc965884000)
  14. librt.so.1 => /lib64/librt.so.1 (0x00007fc96567c000)
  15. libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc96545e000)
  16. libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fc965156000)
  17. libm.so.6 => /lib64/libm.so.6 (0x00007fc964e53000)
  18. libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc964c3c000)
  19. libc.so.6 => /lib64/libc.so.6 (0x00007fc96488d000)
  20. /lib64/ld-linux-x86-64.so.2 (0x00007fc96722b000)
  21. libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007fc964685000)
  22. libuuid.so.1 => /usr/lib64/libuuid.so.1 (0x00007fc964480000)
  23. libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007fc964256000)
  24. libz.so.1 => /lib64/libz.so.1 (0x00007fc964040000)
  25. libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007fc963e03000)
  26. libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fc963be4000)
  27. libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007fc96397e000)
  28. libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fc96377a000)
  29. gerrie@linux-bk94:~/worksheet/creatron/comms_spy/release> ./depends.sh comms_spy
  30. -------------------------------------------------------------------------------------------------------------
  31. ldd-nonnative: find all dependencies of a (potentially) non-native binary comms_spy
  32. -------------------------------------------------------------------------------------------------------------
  33. comms_spy
  34. libgobject-2.0.so.0
  35. libSM.so.6
  36. libICE.so.6
  37. libXrender.so.1
  38. libfontconfig.so.1
  39. libfreetype.so.6
  40. libXext.so.6
  41. libX11.so.6
  42. libdl.so.2
  43. libgthread-2.0.so.0
  44. libglib-2.0.so.0
  45. librt.so.1
  46. libpthread.so.0
  47. libstdc++.so.6
  48. libm.so.6
  49. libgcc_s.so.1
  50. libc.so.6
  51. ld-linux-x86-64.so.2
To copy to clipboard, switch view to plain text mode 

I this now a 'static' build that is suppose to run an 'any' linux box ??