trinity-users@lists.pearsoncomputing.net

Message: previous - next
Month: November 2016

Re: [trinity-users] Struggling with "C++ GUI Programming with Qt 3"

From: Leslie Turriff <jlturriff@...>
Date: Mon, 28 Nov 2016 10:51:54 -0600

On 2016-11-27 18:38:47 Michele Calgaro wrote:
> Sorry,
> my bad, I never realized the code in the online tutorial and the offline
> one are different :-( I actually went through the same tutorial from the
> tqt3 local documents, found in /usr/share/tqt3/doc/html/tutorial1-01.html
> This is basically the same page as the online one, but there are small
> differences in the include files and Qt objects.
>
> ------------------------------
> #include <ntqapplication.h>
> #include <ntqpushbutton.h>
>
> int main( int argc, char **argv )
> {
> � � TQApplication a( argc, argv );
>
> � � TQPushButton hello( "Hello world!", 0 );
> � � hello.resize( 100, 30 );
>
> � � a.setMainWidget( &hello );
> � � hello.show();
> � � return a.exec();
> }
> -------------------------------
>
> Please try again and let us know.
> Cheers
> � Michele

	Okay. Based on your reply and a response from Gregory Guy, I replaced the 
include path
	-I/usr/include/tqt/QT/
with
	-I/usr/include/tqt/
and got this:

| @10:30:57,leslie@...
| ~/Documents/SourceCode/QT/Tutorial1
| $ make
| 
g++ -c -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wall -W -O2  -DQT_NO_DEBUG -I/usr/share/tqt3/mkspecs/default -I. -I. -I/usr/include -I/usr/include/tqt3 -I/usr/include/tqt/ -o 
main.o main.cpp
| g++ -luuid -o Tutorial1 
main.o    -L/usr/lib64 -L/usr/lib64 -L/usr/X11R6/lib64 -luuid -ltqt -lXext -lX11 -lm
| /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: 
main.o: undefined reference to symbol '_ZN7TQGListD0Ev'
| /usr/lib64/libtqt-mt.so.3: error adding symbols: DSO missing from command 
line
| collect2: error: ld returned 1 exit status
| Makefile:88: recipe for target 'Tutorial1' failed
| make: *** [Tutorial1] Error 1

	So apparently I've satisfied the compiler, but not the loader. I see lots of 
files beginning with 'libtqt' in /usr/lib64, and a subdirectory 
called /usr/lib64/tqt3/plugins that looks like parts for a QT development 
tool.  Is the fix as simple as adding "DSO" somewhere in the Makefile? Such 
fun...

Leslie