QT XML compiling error on Mac

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2005
Posts: 52
Reputation: Kob0724 is an unknown quantity at this point 
Solved Threads: 0
Kob0724's Avatar
Kob0724 Kob0724 is offline Offline
Junior Poster in Training

QT XML compiling error on Mac

 
0
  #1
Jul 29th, 2008
I've been trying to compile a program I wrote with QT on a Mac for about a week now and I can't get it to work for the life of me. I'm very confused because the code compiles just fine on a linux machine using a core 2 duo, and also on a Beowulf cluster. I've tried compiling it on both an IMac and a MacBook (both Core 2 Duos) and in each case I get the same compilation errors. The errors seem to be complaining about something called QCoreXmlStreamWriter. I've googled this and I get 0 results (something I found extremely odd). I do not have the words QCoreXmlStreamWriter anywhere in my source code (believe me, I've checked many times). I also made sure that I included the xml module in my QT project file. I am absolutely stumped. Any one have an idea? An example of one of the compile errors along with the make command being used is included below.
  1. etutils.cpp: At global scope:
  2. etutils.cpp:145: error: prototype for 'void SubLineGroup::generateInputFileSection(QCoreXmlStreamWriter&)' does not match any in class 'SubLineGroup'
  3. etutils.h:256: error: candidate is: virtual void SubLineGroup::generateInputFileSection(QXmlStreamWriter&)
  4. etutils.cpp:177: error: prototype for 'void SubComboGroup::generateInputFileSection(QCoreXmlStreamWriter&)' does not match any in class 'SubComboGroup'
  5. etutils.h:300: error: candidate is: virtual void SubComboGroup::generateInputFileSection(QXmlStreamWriter&)
  6. etutils.cpp:199: error: prototype for 'void SubSPGroup::generateInputFileSection(QCoreXmlStreamWriter&)' does not match any in class 'SubSPGroup'
  7. etutils.h:340: error: candidate is: virtual void SubSPGroup::generateInputFileSection(QXmlStreamWriter&)

  1. g++ -c -pipe -g -Wall -W -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.4.0/mkspecs/macx-g++ -I. -I/usr/local/Trolltech/Qt-4.4.0/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.4.0/include/QtCore -I/usr/local/Trolltech/Qt-4.4.0/include/QtCore -I/usr/local/Trolltech/Qt-4.4.0/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.4.0/include/QtGui -I/usr/local/Trolltech/Qt-4.4.0/include/QtGui -I/usr/local/Trolltech/Qt-4.4.0/lib/QtXml.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.4.0/include/QtXml -I/usr/local/Trolltech/Qt-4.4.0/include/QtXml -I/usr/local/Trolltech/Qt-4.4.0/include -I. -I. -I. -F/usr/local/Trolltech/Qt-4.4.0/lib -o etutils.o etutils.cpp
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: QT XML compiling error on Mac

 
0
  #2
Jul 29th, 2008
What version(s) of QT are on the machines which work?

Why do the same directories repeat over and over in the compiler command line?

If you do a search of /usr/local/Trolltech/Qt-4.4.0/include, do any of those files contain QCoreXmlStreamWriter?
If they do, check to see if such references are inside #ifdef ... #endif conditional switches. If they are, you need those switches on the command line.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 52
Reputation: Kob0724 is an unknown quantity at this point 
Solved Threads: 0
Kob0724's Avatar
Kob0724 Kob0724 is offline Offline
Junior Poster in Training

Re: QT XML compiling error on Mac

 
0
  #3
Jul 29th, 2008
Originally Posted by Salem View Post
What version(s) of QT are on the machines which work?

Why do the same directories repeat over and over in the compiler command line?

If you do a search of /usr/local/Trolltech/Qt-4.4.0/include, do any of those files contain QCoreXmlStreamWriter?
If they do, check to see if such references are inside #ifdef ... #endif conditional switches. If they are, you need those switches on the command line.
All computers are using QT 4.4

The qmake program is what generates the make file. Why it decides to include the same directories twice I do not know. When I compile on both the linux box and the beowulf cluster, the same "double include" is in the command as well. In fact the commands on the various platforms all look virtually the same.

I only found QCoreXmlStreamWriter in one file. Here is where it appears:
include/QtCore/qxmlstream.h
  1. #if defined Q_XMLSTREAM_RENAME_SYMBOLS
  2. // don't worry, we'll undef and change to typedef at the bottom of the file
  3. # define QXmlStreamAttribute QCoreXmlStreamAttribute
  4. # define QXmlStreamAttributes QCoreXmlStreamAttributes
  5. # define QXmlStreamEntityDeclaration QCoreXmlStreamEntityDeclaration
  6. # define QXmlStreamEntityDeclarations QCoreXmlStreamEntityDeclarations
  7. # define QXmlStreamEntityResolver QCoreXmlStreamEntityResolver
  8. # define QXmlStreamNamespaceDeclaration QCoreXmlStreamNamespaceDeclaration
  9. # define QXmlStreamNamespaceDeclarations QCoreXmlStreamNamespaceDeclarations
  10. # define QXmlStreamNotationDeclaration QCoreXmlStreamNotationDeclaration
  11. # define QXmlStreamNotationDeclarations QCoreXmlStreamNotationDeclarations
  12. # define QXmlStreamReader QCoreXmlStreamReader
  13. # define QXmlStreamStringRef QCoreXmlStreamStringRef
  14. # define QXmlStreamWriter QCoreXmlStreamWriter
  15. #endif
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: QT XML compiling error on Mac

 
0
  #4
Jul 29th, 2008
Interesting that there's some #define renaming going on.

You could try creating a very simple source file which includes the QT headers in question.
Then compile it with the -E switch, which just runs the code through the pre-processor.

What you should get is a very large .i file which contains the code AFTER the pre-processor has done all it's stuff to the file. Comparing the results between systems may shed some light on what's actually going on.

Unlike your google attempt, searching for QXmlStreamWriter finds lots of stuff.

Also look for Q_XMLSTREAM_RENAME_SYMBOLS in say a config.h file. It could be an install problem which has mis-configured one of the systems.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 52
Reputation: Kob0724 is an unknown quantity at this point 
Solved Threads: 0
Kob0724's Avatar
Kob0724 Kob0724 is offline Offline
Junior Poster in Training

Re: QT XML compiling error on Mac

 
0
  #5
Jul 29th, 2008
The -E garnered no resutls. I'm not looking for stuff about QXmlStreamWrtier (I know all about that), my problem seems to be with this QCoreXmlStreamWriter. I don't think it's an install problem. When I had my friend compile it on his Mac, he installed QT himself. So we both independently installed QT of eachother, and yet we both get the same error. Besides, QT is pretty simple to install.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 52
Reputation: Kob0724 is an unknown quantity at this point 
Solved Threads: 0
Kob0724's Avatar
Kob0724 Kob0724 is offline Offline
Junior Poster in Training

Re: QT XML compiling error on Mac

 
1
  #6
Jul 30th, 2008
Well guys, I figured it out. Many thanks to thiago from the QT mailing list. Here's the deal. I was class forwarding QXmlStreamWriter in my header files, but aparently just on Macs, class forwarding with QXmlStreamWriter or QXmlStreamReader class forwarding does not work. So the soultion was to use
  1. #include <QXmlStreamWriter>
in my header file instead of
  1. class QXmlStreamWriter;
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1
Reputation: kmote is an unknown quantity at this point 
Solved Threads: 0
kmote kmote is offline Offline
Newbie Poster

Re: QT XML compiling error on Mac

 
0
  #7
Sep 3rd, 2008
Originally Posted by Kob0724 View Post
... So the soultion was to use
  1. #include <QXmlStreamWriter>
Actually, this didn't fix the problem for me. I was still getting a linker error ("undefined symbols"). I contacted Trolltech support and was told: "There is a small issue with mac that it still gets confused if you do not specify a full path to the class."
They suggested I try this instead:
  1. #include <QtCore/QXmlStreamWriter>

This fixed the problem. Thanks to Dean at Trolltech.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC