LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-30-2004, 11:47 AM   #1
zombyLINUX
LQ Newbie
 
Registered: Mar 2004
Distribution: SuSE 9.0 KDE 3.1
Posts: 26

Rep: Reputation: 15
Qt Thread Support Problem


Alright, I have solved my problem with compiling a program that contains a class extending QThread by manually making a change to the Makefile generated by qmake.

Here is what the compilation was before I changed it...

g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -o main_QtClock.o main_QtClock.cc

g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -o QtClock.o QtClock.cc

QtClock.cc:14: error: parse error before `{' token
QtClock.cc:19: error: parse error before `}' token
make: *** [QtClock.o] Error 1

I add the -DQT_THREAD_SUPPORT flag to CXXFLAGS, and reran make it it compiled fine. Here is the compile statment after I changed it.

g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -o QtClock.o QtClock.cc

/usr/lib/qt3/bin/moc QtClock.h -o moc_QtClock.cpp

g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -o moc_QtClock.o moc_QtClock.cpp

g++ -o QtClock main_QtClock.o QtClock.o moc_QtClock.o -L/usr/lib/ -L/usr/lib/qt3/lib/ -L/usr/X11R6/lib/ -lqt -lXext -lX11 -lm

My question is how do i reconfigure Qt to make qmake put this flag in without me having to do it every time.

Any ideas...?
 
Old 03-30-2004, 11:59 AM   #2
zombyLINUX
LQ Newbie
 
Registered: Mar 2004
Distribution: SuSE 9.0 KDE 3.1
Posts: 26

Original Poster
Rep: Reputation: 15
Another thing I had to add to the makefile generated by qmake is -lqt-mt to link the multithread libraries. I would also need qmake to put this in the makefile for me.
 
Old 03-30-2004, 02:12 PM   #3
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
When you did ./configure for installing Qt, did you add the -thread option? If not, that would be your problem.
 
Old 03-30-2004, 02:15 PM   #4
zombyLINUX
LQ Newbie
 
Registered: Mar 2004
Distribution: SuSE 9.0 KDE 3.1
Posts: 26

Original Poster
Rep: Reputation: 15
I did an YaST install of qt3, do you think I have to get the tar.gz and then configure it that way to get it to work?
 
Old 03-30-2004, 02:26 PM   #5
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Possibly...I suppose it depends on how SuSE decided to compile the source. I would be surprised if they didn't compile it with thread support, but you never know.

If you do decide to get the source (www.trolltech.com) make sure you read all the documentation and don't forget to include the -thread switch! (Actually I think it warns you that you need it)

Be prepared for a long compile time!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux KGDB Support for the thread debugging jaga143 Linux - General 1 07-28-2005 12:10 PM
QT with thread support ?????? bullwinkle Linux - Software 0 09-22-2004 06:51 AM
compiling Qt with thread support? timberwolf Linux - Software 4 12-06-2003 04:15 PM
compiling qt with thread support stevenhasty Linux - Software 1 07-03-2003 12:07 PM
Qt3 thread support Johng Linux - Software 8 11-02-2002 02:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration