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.

etutils.cpp: At global scope:
etutils.cpp:145: error: prototype for 'void SubLineGroup::generateInputFileSection(QCoreXmlStreamWriter&)' does not match any in class 'SubLineGroup'
etutils.h:256: error: candidate is: virtual void SubLineGroup::generateInputFileSection(QXmlStreamWriter&)
etutils.cpp:177: error: prototype for 'void SubComboGroup::generateInputFileSection(QCoreXmlStreamWriter&)' does not match any in class 'SubComboGroup'
etutils.h:300: error: candidate is: virtual void SubComboGroup::generateInputFileSection(QXmlStreamWriter&)
etutils.cpp:199: error: prototype for 'void SubSPGroup::generateInputFileSection(QCoreXmlStreamWriter&)' does not match any in class 'SubSPGroup'
etutils.h:340: error: candidate is: virtual void SubSPGroup::generateInputFileSection(QXmlStreamWriter&)
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

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.

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

#if defined Q_XMLSTREAM_RENAME_SYMBOLS
// don't worry, we'll undef and change to typedef at the bottom of the file
# define QXmlStreamAttribute QCoreXmlStreamAttribute
# define QXmlStreamAttributes QCoreXmlStreamAttributes
# define QXmlStreamEntityDeclaration QCoreXmlStreamEntityDeclaration
# define QXmlStreamEntityDeclarations QCoreXmlStreamEntityDeclarations
# define QXmlStreamEntityResolver QCoreXmlStreamEntityResolver
# define QXmlStreamNamespaceDeclaration QCoreXmlStreamNamespaceDeclaration
# define QXmlStreamNamespaceDeclarations QCoreXmlStreamNamespaceDeclarations
# define QXmlStreamNotationDeclaration QCoreXmlStreamNotationDeclaration
# define QXmlStreamNotationDeclarations QCoreXmlStreamNotationDeclarations
# define QXmlStreamReader QCoreXmlStreamReader
# define QXmlStreamStringRef QCoreXmlStreamStringRef
# define QXmlStreamWriter QCoreXmlStreamWriter
#endif

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.

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.

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

#include <QXmlStreamWriter>

in my header file instead of

class QXmlStreamWriter;
Comments
Thanks for the feedback, and congrats on getting a solution :)

... So the soultion was to use

#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:

#include <QtCore/QXmlStreamWriter>

This fixed the problem. Thanks to Dean at Trolltech.

This question has already been answered. Start a new discussion instead.