trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: December 2011

Re: [trinity-devel] Autotools package builds

From: Laurent Dard <f.couperin@...>
Date: Fri, 16 Dec 2011 19:44:58 +0100
Le 16/12/2011 15:32, /dev/ammo42 a écrit :
> The linker forgot to link the Qt library.

Yes. I forgot "-lqt-mt" in my test...

My version of qt is the git one (TQt3), and this test compiles
with -ltqt-mt (and QApplication replaced by TQApplication):

> echo "#include <qapplication.h>
> int main(int argc, char **argv)
> { TQApplication app(argc, argv); return 0; }" |
> gcc --verbose -x c++ - \
>   -I/usr/include/qt \
>   -L/usr/lib64 \
>   -ltqt-mt
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.6.1/configure --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-clocale=gnu --enable-languages=c,c++,fortran --disable-libstdcxx-pch --with-system-zlib --enable-bootstrap
Thread model: posix
gcc version 4.6.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-I' '/usr/include/qt' '-L/usr/lib64' '-mtune=generic' '-march=x86-64'
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus -quiet -v -I /usr/include/qt -D_GNU_SOURCE - -quiet -dumpbase - -mtune=generic -march=x86-64 -auxbase - -version -o /tmp/ccaji7Kr.s
GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/qt
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/x86_64-unknown-linux-gnu
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/backward
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include
 /usr/local/include
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include-fixed
 /usr/include
End of search list.
GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: a8d7778be5bd8b39de05fe54f871cfea
COLLECT_GCC_OPTIONS='-v' '-I' '/usr/include/qt' '-L/usr/lib64' '-mtune=generic' '-march=x86-64'
 as --64 -o /tmp/ccRcu0Sy.o /tmp/ccaji7Kr.s
COMPILER_PATH=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-I' '/usr/include/qt' '-L/usr/lib64' '-mtune=generic' '-march=x86-64'
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/crtbegin.o -L/usr/lib64 -L/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1 -L/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../.. /tmp/ccRcu0Sy.o -ltqt-mt -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/crtend.o /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/crtn.o


>>> echo "#include <qapplication.h>
>>> int main(int argc, char **argv)
>>> { QApplication app(argc, argv); return 0; }" |
>>> gcc --verbose -x c++ - \
>>>   `pkg-config --cflags --libs qt-mt`
...
> The linker even forgets linking the libstdc++, but not libqt-mt this
> time. Perhaps this is because of using 'gcc -x c++' instead of 'g++', I
> don't really know because I always use the latter.

Here it works perfectly, on Debian with the stable version and on LFS with
the git one.

On LFS:

> echo "#include <qapplication.h>
> int main(int argc, char **argv)
> { TQApplication app(argc, argv); return 0; }" |
> gcc --verbose -x c++ - \
>   `pkg-config --cflags --libs tqt-mt`
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.6.1/configure --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-clocale=gnu --enable-languages=c,c++,fortran --disable-libstdcxx-pch --with-system-zlib --enable-bootstrap
Thread model: posix
gcc version 4.6.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-D' 'QT_SHARED' '-D' 'QT_TABLET_SUPPORT' '-D' 'QT_NO_DEBUG' '-D' 'QT_THREAD_SUPPORT' '-D' '_REENTRANT' '-I' '/usr/include/qt' '-L/usr/lib64' '-L/usr/X11R7/lib64' '-mtune=generic' '-march=x86-64'
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus -quiet -v -I /usr/include/qt -D_GNU_SOURCE -D QT_SHARED -D QT_TABLET_SUPPORT -D QT_NO_DEBUG -D QT_THREAD_SUPPORT -D _REENTRANT - -quiet -dumpbase - -mtune=generic -march=x86-64 -auxbase - -version -o /tmp/cch2LRs9.s
GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/qt
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/x86_64-unknown-linux-gnu
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/backward
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include
 /usr/local/include
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include-fixed
 /usr/include
End of search list.
GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: a8d7778be5bd8b39de05fe54f871cfea
COLLECT_GCC_OPTIONS='-v' '-D' 'QT_SHARED' '-D' 'QT_TABLET_SUPPORT' '-D' 'QT_NO_DEBUG' '-D' 'QT_THREAD_SUPPORT' '-D' '_REENTRANT' '-I' '/usr/include/qt' '-L/usr/lib64' '-L/usr/X11R7/lib64' '-mtune=generic' '-march=x86-64'
 as --64 -o /tmp/ccyoRtIW.o /tmp/cch2LRs9.s
COMPILER_PATH=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-D' 'QT_SHARED' '-D' 'QT_TABLET_SUPPORT' '-D' 'QT_NO_DEBUG' '-D' 'QT_THREAD_SUPPORT' '-D' '_REENTRANT' '-I' '/usr/include/qt' '-L/usr/lib64' '-L/usr/X11R7/lib64' '-mtune=generic' '-march=x86-64'
 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/crtbegin.o -L/usr/lib64 -L/usr/X11R7/lib64 -L/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1 -L/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../.. /tmp/ccyoRtIW.o -ltqt-mt -lz -lGL -lXmu -lXi -lXrender -lXrandr -lXcursor -lXinerama -lXft -lfreetype -lfontconfig -lXext -lX11 -lm -lSM -lICE -ldl -lpthread -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/crtend.o /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/crtn.o



-- 
Laurent Dard