[xsd-users] Compiling XSD with Qt Creator (Qt v4.6)

Jim Pacyga jim.pacyga at control-pt.com
Wed May 5 15:20:23 EDT 2010


Hi Boris,

Thank you for the instructions on building Xerces with Cygwin.  I've
accomplished that and it seemed to build without errors.  However, I am
still struggling with the next step of compiling a project in Qt Creator
that uses the library.  I'm getting a bunch of "undefined reference"s during
link time.  If it helps, the following lists my "main.cpp" file (which does
nothing but include my generated class) and the Qt .pro file.  You should
easily be able to reproduce this (using your own generated .h file from XSD)
using Qt Creator.

Any additional help would be appreciated.

Thanks,
Jim


main.cpp:

#include <iostream>
#include "VhmVddmMsgsV0_0.hxx"

int main(int argc, char *argv[])
{


   return 0;
}



xml_example.pro:

TARGET = xml_example
TEMPLATE = app
LIBS += -L"C:\Program Files\CodeSynthesis XSD 3.3\xerces-c-3.1.1\src\.libs"
-lxerces-c
INCLUDEPATH += "C:\Program Files\CodeSynthesis XSD 3.3\include" \
               "C:\Program Files\CodeSynthesis XSD 3.3\xerces-c-3.1.1\src"
SOURCES += main.cpp \
    VhmVddmMsgsV0_0.cxx
HEADERS += VhmVddmMsgsV0_0.hxx





----------------------------------
Jim Pacyga
Software Engineer
Control Point Corporation
(248) 740-1512 x227


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Wednesday, May 05, 2010 2:02 PM
To: Jim Pacyga
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] Compiling XSD with Qt Creator (Qt v4.6)

Hi Jim,

Jim Pacyga <jim.pacyga at control-pt.com> writes:

> I've tried compiling Xerces-C in Cygwin using the instructions here:
> 
> http://www.codesynthesis.com/projects/xsd/extras/build-windows.xhtml
> 
> The Xerces library compiles fine, but the resulting library (.a file) does
> not seem to satisfy Qt Creator when linking.

I have downloaded Qt Creator and gave it a try. I have added the
instructions to the Wiki:

http://wiki.codesynthesis.com/Using_XSD_with_Qt_Creator

I got to the step 5. That is, I successfully built XSD examples
with Xerces-C++ built with Qt's MinGW compiler. While I haven't
tried to create a project in Qt Creator, I don't see a reason
why this won't work. Also, it would be great if you could expand
the above page to include some specific information about where
and how to add the various search paths. Also, if you are planning
to add XSD as a custom build step to Qt Reactor, instructions on
that would be most welcome as well.

Boris



More information about the xsd-users mailing list