Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. I've already figured out that I need to substitute 'tqmake' for 'qmake', but I can't get the simple 'helloworld' project to actually compile the c++ code. I've got the project generated, and I see the code in its src/ directory, but when I try to build it (the book says to use 'make') it says "make: Nothing to be done for 'first'." Here is the Makefile generated by tqmake:
########################################################################### Makefile for building: Tutorial1 Generated by qmake (1.07a) (TQt 3.5.0) on: Wed Nov 16 22:57:35 2016 Project: Tutorial1.pro Template: subdirs Command: $(QMAKE) -o Makefile Tutorial1.pro ###########################################################################
MAKEFILE = Makefile MAKE = tqmake DEL_FILE = rm -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p INSTALL_FILE= INSTALL_DIR = SUBTARGETS =
first: all
all: Makefile $(SUBTARGETS)
Makefile: Tutorial1.pro /usr/share/tqt3/mkspecs/default/qmake.conf $(QMAKE) -o Makefile Tutorial1.pro qmake: qmake_all @$(QMAKE) -o Makefile Tutorial1.pro
all qmake_all distclean uicables mocables install_subdirs uninstall_subdirs
uiclean mocclean lexclean yaccclean clean : FORCE
install: install_subdirs
uninstall: uninstall_subdirs
FORCE:
And here is the Project file:
###################################################################### # Automatically generated by qmake (1.07a) Wed Nov 16 22:47:58 2016 ######################################################################
TEMPLATE = subdirs
# Directories
Are there additional steps required when compiling a QT project in Trinity?
Leslie
On 2016/11/17 01:02 PM, Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. I've already figured out that I need to substitute 'tqmake' for 'qmake', but I can't get the simple 'helloworld' project to actually compile the c++ code. I've got the project generated, and I see the code in its src/ directory, but when I try to build it (the book says to use 'make') it says "make: Nothing to be done for 'first'." Here is the Makefile generated by tqmake:
########################################################################### Makefile for building: Tutorial1 Generated by qmake (1.07a) (TQt 3.5.0) on: Wed Nov 16 22:57:35 2016 Project: Tutorial1.pro Template: subdirs Command: $(QMAKE) -o Makefile Tutorial1.pro ###########################################################################
MAKEFILE = Makefile MAKE = tqmake DEL_FILE = rm -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p INSTALL_FILE= INSTALL_DIR = SUBTARGETS =
first: all
all: Makefile $(SUBTARGETS)
Makefile: Tutorial1.pro /usr/share/tqt3/mkspecs/default/qmake.conf $(QMAKE) -o Makefile Tutorial1.pro qmake: qmake_all @$(QMAKE) -o Makefile Tutorial1.pro
all qmake_all distclean uicables mocables install_subdirs uninstall_subdirs
uiclean mocclean lexclean yaccclean clean : FORCE
install: install_subdirs
uninstall: uninstall_subdirs
FORCE:
And here is the Project file:
###################################################################### # Automatically generated by qmake (1.07a) Wed Nov 16 22:47:58 2016 ######################################################################
TEMPLATE = subdirs
# Directories
Are there additional steps required when compiling a QT project in Trinity?
Leslie
Take a look at the QT3 tutorial here https://www.trinitydesktop.org/docs/qt3/tutorial.html Should be able to get you started with TQt ;-) Cheers Michele
On 2016-11-17 07:17:00 Michele Calgaro wrote:
On 2016/11/17 01:02 PM, Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. I've already figured out that I need to substitute 'tqmake' for 'qmake', but I can't get the simple 'helloworld' project to actually compile the c++ code. I've got the project generated, and I see the code in its src/ directory, but when I try to build it (the book says to use 'make') it says "make: Nothing to be done for 'first'."
Take a look at the QT3 tutorial here https://www.trinitydesktop.org/docs/qt3/tutorial.html Should be able to get you started with TQt ;-) Cheers Michele
Okay, I tried that and got exactly the same results. The tutorial you cited even has the same mistaken instruction to use qmake instead of tqmake.
Leslie
Am Sonntag, 27. November 2016 schrieb Leslie Turriff:
On 2016-11-17 07:17:00 Michele Calgaro wrote:
On 2016/11/17 01:02 PM, Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. I've already figured out that I need to substitute 'tqmake' for 'qmake', but I can't get the simple 'helloworld' project to actually compile the c++ code. I've got the project generated, and I see the code in its src/ directory, but when I try to build it (the book says to use 'make') it says "make: Nothing to be done for 'first'."
Take a look at the QT3 tutorial here https://www.trinitydesktop.org/docs/qt3/tutorial.html Should be able to get you started with TQt ;-) Cheers Michele
Okay, I tried that and got exactly the same results. The tutorial you cited even has the same mistaken instruction to use qmake instead of tqmake.
It's essentally the tutorial from Trolltech of 2005. It would be nice if "somebody" who is working through that stuff could adapt it on the fly.
Nik
On 2016/11/27 11:11 AM, Leslie Turriff wrote:
On 2016-11-17 07:17:00 Michele Calgaro wrote:
On 2016/11/17 01:02 PM, Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. I've already figured out that I need to substitute 'tqmake' for 'qmake', but I can't get the simple 'helloworld' project to actually compile the c++ code. I've got the project generated, and I see the code in its src/ directory, but when I try to build it (the book says to use 'make') it says "make: Nothing to be done for 'first'."
Take a look at the QT3 tutorial here https://www.trinitydesktop.org/docs/qt3/tutorial.html Should be able to get you started with TQt ;-) Cheers Michele
Okay, I tried that and got exactly the same results. The tutorial you cited even has the same mistaken instruction to use qmake instead of tqmake.
Leslie
I tried tutorial 1: copied the code to a .cpp file, followed the exact instructions (except replacing qmake with tqmake as you already pointed out). Works perfectly on my system. This is a pretty basic tutorial ofcourse, no TDE stuff there, no tqtinterface. Try to give it a second try :-) Cheers Michele
On 2016-11-27 06:03:30 Michele Calgaro wrote:
On 2016/11/27 11:11 AM, Leslie Turriff wrote:
On 2016-11-17 07:17:00 Michele Calgaro wrote:
On 2016/11/17 01:02 PM, Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. I've already figured out that I need to substitute 'tqmake' for 'qmake', but I can't get the simple 'helloworld' project to actually compile the c++ code. I've got the project generated, and I see the code in its src/ directory, but when I try to build it (the book says to use 'make') it says "make: Nothing to be done for 'first'."
Take a look at the QT3 tutorial here https://www.trinitydesktop.org/docs/qt3/tutorial.html Should be able to get you started with TQt ;-) Cheers Michele
Okay, I tried that and got exactly the same results. The tutorial you cited even has the same mistaken instruction to use qmake instead of tqmake.
Leslie
I tried tutorial 1: copied the code to a .cpp file, followed the exact instructions (except replacing qmake with tqmake as you already pointed out). Works perfectly on my system. This is a pretty basic tutorial ofcourse, no TDE stuff there, no tqtinterface. Try to give it a second try :-) Cheers Michele
Okay, I removed all files from my Tutorial1 directory, and started over. Here's what I get:
@06:19:45,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ echo '/**************************************************************** ** ** Qt tutorial 1 ** ****************************************************************/
#include <qapplication.h> #include <qpushbutton.h>
int main( int argc, char **argv ) { QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); a.setMainWidget( &hello ); hello.show(); return a.exec();
}' >main.cpp @06:20:02,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . └── main.cpp
0 directories, 1 file @06:20:21,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tqmake -project @06:20:29,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . ├── main.cpp └── Tutorial1.pro
0 directories, 2 files @06:20:31,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tqmake @06:20:38,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . ├── main.cpp ├── Makefile └── Tutorial1.pro
0 directories, 3 files @06:20:40,leslie@pinto.sixys.site ~/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 -o main.o main.cpp
main.cpp:7:26: fatal error: qapplication.h: No such file or directory #include <qapplication.h> ^ compilation terminated. Makefile:67: recipe for target 'main.o' failed make: *** [main.o] Error 1 @06:20:46,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . ├── main.cpp ├── Makefile └── Tutorial1.pro
0 directories, 3 files
So, different, but still not working. I searched for qapplication.h and found it in /usr/include/tqt/QT/, but adding -I/usr/include/tqt/QT/ to the Makefile INCPATH made no difference.
@06:32:33,leslie@pinto.sixys.site ~/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/QT/ -o main.o main.cpp
main.cpp:7:26: fatal error: qapplication.h: No such file or directory #include <qapplication.h> ^ compilation terminated. Makefile:67: recipe for target 'main.o' failed make: *** [main.o] Error 1
Leslie
On Sun, 27 Nov 2016 06:37:01 -0600 Leslie Turriff jlturriff@mail.com wrote:
On 2016-11-27 06:03:30 Michele Calgaro wrote:
On 2016/11/27 11:11 AM, Leslie Turriff wrote:
On 2016-11-17 07:17:00 Michele Calgaro wrote:
On 2016/11/17 01:02 PM, Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in
[...]
So, different, but still not working. I searched for qapplication.h and found it in /usr/include/tqt/QT/, but adding -I/usr/include/tqt/QT/ to the Makefile INCPATH made no difference.
@06:32:33,leslie@pinto.sixys.site ~/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/QT/ -o main.o main.cpp
main.cpp:7:26: fatal error: qapplication.h: No such file or directory #include <qapplication.h> ^ compilation terminated. Makefile:67: recipe for target 'main.o' failed make: *** [main.o] Error 1
If I had to guess:
For anything with a "q" prefix, check for an equivalent with a "tq" prefix (in this case, "tqapplication.h"), and if it exists, use the "tq" version. And in general, using things in the QT subdirectory without going through a wrapper outside it may not be a good idea.
We used to have a KDE3 -> TDE application conversion tool--it's probably still in git somewhere. While it wasn't perfect, studying it might give you some idea of what changes you need to make.
E. Liddell
On 2016/11/27 09:37 PM, Leslie Turriff wrote:
On 2016-11-27 06:03:30 Michele Calgaro wrote:
On 2016/11/27 11:11 AM, Leslie Turriff wrote:
On 2016-11-17 07:17:00 Michele Calgaro wrote:
On 2016/11/17 01:02 PM, Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. I've already figured out that I need to substitute 'tqmake' for 'qmake', but I can't get the simple 'helloworld' project to actually compile the c++ code. I've got the project generated, and I see the code in its src/ directory, but when I try to build it (the book says to use 'make') it says "make: Nothing to be done for 'first'."
Take a look at the QT3 tutorial here https://www.trinitydesktop.org/docs/qt3/tutorial.html Should be able to get you started with TQt ;-) Cheers Michele
Okay, I tried that and got exactly the same results. The tutorial you cited even has the same mistaken instruction to use qmake instead of tqmake.
Leslie
I tried tutorial 1: copied the code to a .cpp file, followed the exact instructions (except replacing qmake with tqmake as you already pointed out). Works perfectly on my system. This is a pretty basic tutorial ofcourse, no TDE stuff there, no tqtinterface. Try to give it a second try :-) Cheers Michele
Okay, I removed all files from my Tutorial1 directory, and started over. Here's what I get:
@06:19:45,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ echo '/**************************************************************** ** ** Qt tutorial 1 ** ****************************************************************/
#include <qapplication.h> #include <qpushbutton.h>
int main( int argc, char **argv ) { QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); a.setMainWidget( &hello ); hello.show(); return a.exec();
}' >main.cpp @06:20:02,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . └── main.cpp
0 directories, 1 file @06:20:21,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tqmake -project @06:20:29,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . ├── main.cpp └── Tutorial1.pro
0 directories, 2 files @06:20:31,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tqmake @06:20:38,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . ├── main.cpp ├── Makefile └── Tutorial1.pro
0 directories, 3 files @06:20:40,leslie@pinto.sixys.site ~/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 -o main.o main.cpp
main.cpp:7:26: fatal error: qapplication.h: No such file or directory #include <qapplication.h> ^ compilation terminated. Makefile:67: recipe for target 'main.o' failed make: *** [main.o] Error 1 @06:20:46,leslie@pinto.sixys.site ~/Documents/SourceCode/QT/Tutorial1 $ tree -a . ├── main.cpp ├── Makefile └── Tutorial1.pro
0 directories, 3 files
So, different, but still not working. I searched for qapplication.h and found it in /usr/include/tqt/QT/, but adding -I/usr/include/tqt/QT/ to the Makefile INCPATH made no difference.
@06:32:33,leslie@pinto.sixys.site ~/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/QT/ -o main.o main.cpp
main.cpp:7:26: fatal error: qapplication.h: No such file or directory #include <qapplication.h> ^ compilation terminated. Makefile:67: recipe for target 'main.o' failed make: *** [main.o] Error 1
Leslie
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
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@pinto.sixys.site | ~/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
On 2016-11-28 13:52:56 deloptes wrote:
Leslie Turriff wrote:
g++ -luuid -o Tutorial1 main.o -L/usr/lib64 -L/usr/lib64 -L/usr/X11R6/lib64 -luuid -ltqt -lXext -lX11 -lm
Add link to tqt-mt lib
g++ ... -lX11 -lm -ltqt-mt
...and that fixes it. How would I have known that?
It is called the linker not the loader btw.
Yes, of course. I misspoke. :-)
Leslie
On 2016-11-28 13:52:56 deloptes wrote:
Leslie Turriff wrote:
g++ -luuid -o Tutorial1 main.o -L/usr/lib64 -L/usr/lib64 -L/usr/X11R6/lib64 -luuid -ltqt -lXext -lX11 -lm
Add link to tqt-mt lib
g++ ... -lX11 -lm -ltqt-mt
...and that fixes it. How would I have known that?
It sounds like we have some documentation to update on the Wiki. Do you mind getting some notes together on what was unexpected / what you had to fix? Many of the main developers (including myself) are so used to working on TDE that we rarely have the opportunity to see the tools through fresh eyes, as you have just (painfully) done.
Thanks!
I'll see what I can do to help with this.
One of the things that I noticed (quite early, fortunately) is that the documentation in /usr/share/tqt3/doc/html/ appears to be the old Qt docs, superficially updated by globally changing all of the 'Qt's to 'TQt', while not fixing pointers to old Qt external references, many of which don't seem to work any more; e.g., the link on theHow to Learn TQt page to 'the official TQt book, C++ GUI Programming with TQt 3 (ISBN 0-13-124072-2)', which points to an old QT3 book, and the links to the TrollTech website. This makes me wonder how much of the content is actually for the old non-TQt code?
On 2016-11-28 16:43:52 Timothy Pearson wrote:
It sounds like we have some documentation to update on the Wiki. Do you mind getting some notes together on what was unexpected / what you had to fix? Many of the main developers (including myself) are so used to working on TDE that we rarely have the opportunity to see the tools through fresh eyes, as you have just (painfully) done.
Thanks!
Leslie Turriff wrote:
I'll see what I can do to help with this.
One of the things that I noticed (quite early, fortunately) is that the documentation in /usr/share/tqt3/doc/html/ appears to be the old Qt docs, superficially updated by globally changing all of the 'Qt's to 'TQt', while not fixing pointers to old Qt external references, many of which don't seem to work any more; e.g., the link on theHow to Learn TQt page to 'the official TQt book, C++ GUI Programming with TQt 3 (ISBN 0-13-124072-2)', which points to an old QT3 book, and the links to the TrollTech website. This makes me wonder how much of the content is actually for the old non-TQt code?
I guess no one has the time to go through it and make it right. I also think it was passed through a script to update the code related stuff like the names of the classes that have been already moved to tqt naming convention, but obviously the underlaying stuff like links is not perfect. However, if I may share my experience, the documentation is very useful per se - much of it is in the header files anyway and when you know a bit of Qt it is easy to understand what needs to be done. You have a lot of working code as an example as well. The TrollTech website seems to be a dead end - last time I visited it via the documentation. I now maintain a local copy of most of the documentation, via the doc packages. I must also admit it is hard to find your way around. Finally I am just asking here in the newsgroup and usually someone answers (Michele or Slavek).
regards
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@pinto.sixys.site | ~/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
DSO should stand for Dynamic Shared Object.
main.o does not seem to link with libtqt-mt.so.3 ( -ltqt-mt )
If your application does not link with, then you should add it in the "LIBS" part of the Makefile.
@+
On 2016-11-16 23:02:47 Leslie Turriff wrote:
Hi, I'm trying to learn to write a GUI app using the book "C++ GUI Programming with Qt 3", which of course is not written with Trinity in mind, but hopefully will be enough to get me started. :
Looking in /usr/include, I see two subdirectories related to Trinity, tqt/ and tqt3/. The first appears to be ~90% c headers, while the second seems to be mostly c++ headers. How does one know which are appropriate for a piece of code? I also notice that while Tutorial1 seems to work okay with tqapplication.h and tqpushbutton.h, there also exist ntqapplication.h and ntqpushbutton.h. Again, how does one know which to use?
Leslie
I also notice that while Tutorial1 seems to work okay with tqapplication.h and tqpushbutton.h, there also exist ntqapplication.h and ntqpushbutton.h. Again, how does one know which to use?
To try to keep it simple, the ntq* headers are tqt3 header files. The tq* are the tqtinterface header files. The tqtinterface was an intermediate layer that was born to support the migration of TDE to qt4. In the end TDE remained with tqt3, but the tqtinterface was already part of the code and it stayed.
If you are only interested in qt, you can use the ntq* headers, but normally we use the tq* ones. When you move to TDE development there will also be the TDE headers and additional libraries needs to be linked.
Cheers Michele
On 2016-11-28 19:39:46 Michele Calgaro wrote:
I also notice that while Tutorial1 seems to work okay with tqapplication.h and tqpushbutton.h, there also exist ntqapplication.h and ntqpushbutton.h. Again, how does one know which to use?
To try to keep it simple, the ntq* headers are tqt3 header files. The tq* are the tqtinterface header files. The tqtinterface was an intermediate layer that was born to support the migration of TDE to qt4. In the end TDE remained with tqt3, but the tqtinterface was already part of the code and it stayed.
Sounds like tq* is the preferred API, but the examples all seem to use ntq*.
If you are only interested in qt,
As opposed to what?
you can use the ntq* headers, but normally we use the tq* ones. When you move to TDE development there will also be the TDE headers and additional libraries needs to be linked.
At this point, I think that the TDE parts are probably way too advanced for me. :-)
Leslie
On 2016/11/30 09:22 AM, Leslie Turriff wrote:
On 2016-11-28 19:39:46 Michele Calgaro wrote:
I also notice that while Tutorial1 seems to work okay with tqapplication.h and tqpushbutton.h, there also exist ntqapplication.h and ntqpushbutton.h. Again, how does one know which to use?
To try to keep it simple, the ntq* headers are tqt3 header files. The tq* are the tqtinterface header files. The tqtinterface was an intermediate layer that was born to support the migration of TDE to qt4. In the end TDE remained with tqt3, but the tqtinterface was already part of the code and it stayed.
Sounds like tq* is the preferred API, but the examples all seem to use ntq*.
The original Qt3 framework used the q* API. In TDE, Qt3 has become TQt3, thus the tq* API. Since the introduction of the TQtInterface, the TQT3's tq* API has become ntq* API and the tq* has been moved to the TQtInterface level. See the sketch attached, hope it helps to nuderstand better
If you are only interested in qt,
As opposed to what?
Opposed to "the whole TDE environment"
you can use the ntq* headers, but normally we use the tq* ones. When you move to TDE development there will also be the TDE headers and additional libraries needs to be linked.
At this point, I think that the TDE parts are probably way too advanced for me. :-)
Leslie
On 2016-11-29 19:55:21 Michele Calgaro wrote:
On 2016/11/30 09:22 AM, Leslie Turriff wrote: : The original Qt3 framework used the q* API. In TDE, Qt3 has become TQt3, thus the tq* API. Since the introduction of the TQtInterface, the TQT3's tq* API has become ntq* API and the tq* has been moved to the TQtInterface level. See the sketch attached, hope it helps to nuderstand better
So, TDE API = TDE* TQtInterface = tq* TQt3 = ntq* <== and I should use this one. correct?
Leslie
Leslie Turriff wrote:
On 2016-11-29 19:55:21 Michele Calgaro wrote:
On 2016/11/30 09:22 AM, Leslie Turriff wrote: : The original Qt3 framework used the q* API. In TDE, Qt3 has become TQt3, thus the tq* API. Since the introduction of the TQtInterface, the TQT3's tq* API has become ntq* API and the tq* has been moved to the TQtInterface level. See the sketch attached, hope it helps to nuderstand better
So, TDE API = TDE* TQtInterface = tq* TQt3 = ntq* <== and I should use this one. correct?
Leslie
Leslie, feel free to use whatever suits your needs the best. Just have a look into those files and it will be clear to you, that you can use for what purpose. As Michele already said "If you are only interested in qt, you can use the ntq* headers, but normally we use the tq* ones."
regards
On 2016/11/30 03:37 PM, deloptes wrote:
Leslie Turriff wrote:
On 2016-11-29 19:55:21 Michele Calgaro wrote:
On 2016/11/30 09:22 AM, Leslie Turriff wrote: : The original Qt3 framework used the q* API. In TDE, Qt3 has become TQt3, thus the tq* API. Since the introduction of the TQtInterface, the TQT3's tq* API has become ntq* API and the tq* has been moved to the TQtInterface level. See the sketch attached, hope it helps to nuderstand better
So, TDE API = TDE* TQtInterface = tq* TQt3 = ntq* <== and I should use this one. correct?
Leslie
Leslie, feel free to use whatever suits your needs the best. Just have a look into those files and it will be clear to you, that you can use for what purpose. As Michele already said "If you are only interested in qt, you can use the ntq* headers, but normally we use the tq* ones."
regards
Emanoil explained very well my point. In TDE we mostly work with TDE and tqtinterface API, but since you are just starting out with TQt, it would be easier to start from the ntq* API and later move to TDE level. Basically the more complex an API is, the more you need to know. Just find out what fits the best for your current level and move forward from there ;-)