Results 1 to 1 of 1

Thread: Using Code Synthesis XSD in Visual Studio in Qt projects

  1. #1
    Join Date
    Dec 2010
    Posts
    35
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Using Code Synthesis XSD in Visual Studio in Qt projects

    I'm starting the 'address book' in the Qt tutorial section on Windows using Visual Studio Express 2008. Nice tutorial, BTW.

    My real goal is to incorporate a number of 3rd party toolkits - I use that address book demo as my test bed.

    The first one is XSD data binding from Code Synthesis.

    That toolkit is an XML data binding package that seems to work pretty well for what I need. It works well on Linux n Mac but I'm having problems getting it to link into my Qt project. It requires use of the Xerces-C++ package from Apache. I downloaded the pre-build VC9.0 binaries/libraries for that.

    I'm using VSE 2008 (makefile-based project) and I'm getting lots of undefined symbols. For the Xerces-C++ library I'm using the lib\xerces-c_3.lib library found in that distribution. I know that library file exists because if I mistype that library name the link fails quickly with 'unable to find library file' (or something like that):
    Qt Code:
    1. hello.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getEncoding(void)const " (?getEncoding@InputSource@xercesc_3_1@@UBEPBGXZ)
    2. hello.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getPublicId(void)const " (?getPublicId@InputSource@xercesc_3_1@@UBEPBGXZ)
    3. hello.obj : error LNK2001: unresolved external symbol "public: virtual unsigned short const * __thiscall xercesc_3_1::InputSource::getSystemId(void)const " (?getSystemId@InputSource@xercesc_3_1@@UBEPBGXZ)
    To copy to clipboard, switch view to plain text mode 
    Has anyone else successfully incorporated the Code Synthesis/Xerces-C++ packages into a Qt project using MS VS?

    Thanks.


    Added after 1 58 minutes:


    Quote Originally Posted by redBeard View Post
    I'm using VSE 2008 (makefile-based project) and I'm getting lots of undefined symbols. For the Xerces-C++ library I'm using the lib\xerces-c_3.lib library found in that distribution. I know that library file exists because if I mistype that library name the link fails quickly with 'unable to find library file' (or something like that):

    Has anyone else successfully incorporated the Code Synthesis/Xerces-C++ packages into a Qt project using MS VS?
    I think I figured this one out, as well (at least using the hello.xsd from the Code Synthesis XSD sample directory).....

    When 'qmake' generates the makefiles for Visual Studio builds, specifies a compiler option, '/Zc:wchar_t-', which means the system requires you (the developer) to define the 'wchar_t' type. All files of the project are compiled with this option.

    The Xerces-C++ compiled binaries for VS 2008 (9.0) specify this option as '/Zc:wchar_t' (no trailing dash), which means treat the 'wchar_t' type as native. Also, the VC9.0 project files in the source distribution have this set, as well. I downloaded the source source distribution and compiled this package and experienced the same errors.

    Apparently mixing modes in an application is no-no......

    I just set the '/Zc:wchar_t' option in my project makefile, did a build all and it compiled and worked!

    Wow. Not to comment on the news, but HOCO - Holy Obscure Compiler Options, Batman....

    On to the next problems....
    Last edited by redBeard; 5th January 2011 at 22:59.

Similar Threads

  1. Replies: 8
    Last Post: 28th October 2013, 02:08
  2. Building 64 bit visual studio projects .sln
    By drescherjm in forum Qt Tools
    Replies: 1
    Last Post: 19th April 2011, 00:13
  3. Visual Studio Plugin (1.1.6) crashes Visual Studio (2010)
    By mboeni in forum Installation and Deployment
    Replies: 0
    Last Post: 11th October 2010, 17:46
  4. qt visual studio add-in source code
    By GreenScape in forum General Programming
    Replies: 2
    Last Post: 3rd August 2010, 12:50
  5. Replies: 0
    Last Post: 13th November 2008, 11:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.