Qt4 with VS2003



  • For a few reasons, I am required to use VS2003 right now in Qt4. I am trying to configure it properly with Qt4 but having some issues. It recognizes VS2003 but won't build properly. I'm trying to run the configure.exe and it errors out because some of the directories are no longer in the same location. Any help would be great!

    Edited: it's Qt, not QT.



  • AFAIK, VS2003 is not anymore supported.
    What does confige write as error? Which dirs are missing? A bit more information would help.



  • Yeah I know it's no longer supported. 2005 is the last that is acknowledged in the package manager. I will post up the errors tomorrow



  • I have managed to successfully compile Qt 4.7.3 with an out-of-the box VS2003, so it is possible. I'll try to help you once you post the errors.



  • Alright I'm getting tons of errors atm upon building configure.exe here is so far.
    @
    In file included from project.cpp:42:
    project.h:45:25: error: qstringlist.h: No such file or directory
    project.h:46:25: error: qtextstream.h: No such file or directory
    project.h:47:21: error: qstring.h: No such file or directory
    project.h:48:20: error: qstack.h: No such file or directory
    project.h:49:18: error: qmap.h: No such file or directory
    project.h:50:23: error: qmetatype.h: No such file or directory
    In file included from project.cpp:44:
    option.h:48:19: error: qfile.h: No such file or directory
    In file included from project.cpp:45:
    cachekeys.h:49:23: error: qfileinfo.h: No such file or directory
    cachekeys.h:50:19: error: qhash.h: No such file or directory
    In file included from project.cpp:46:
    generators/metamakefile.h:47:19: error: qlist.h: No such file or directory
    project.cpp:48:23: error: qdatetime.h: No such file or directory
    project.cpp:51:18: error: qdir.h: No such file or directory
    project.cpp:52:21: error: qregexp.h: No such file or directory
    project.cpp:56:20: error: qdebug.h: No such file or directory@

    @option.h: At global scope:
    option.h:80: error: 'QStringList' does not name a type
    option.h:81: error: 'QStringList' does not name a type
    option.h:82: error: 'QStringList' does not name a type
    option.h:149: error: 'QFile' does not name a type
    option.h:155: error: 'QStringList' does not name a type
    option.h:163: error: 'QStringList' does not name a type
    option.h:167: error: 'QStringList' does not name a type
    option.h:173: error: 'QStringList' does not name a type
    option.h:187: error: 'QStringList' does not name a type@

    @
    In file included from project.cpp:45:
    cachekeys.h:58: error: field 'string' has incomplete type
    cachekeys.h:58: error: field 'pwd' has incomplete type
    cachekeys.h: In constructor 'FixStringCacheKey::FixStringCacheKey(const QString&
    , uchar)':
    cachekeys.h:63: error: 'pwd' was not declared in this scope
    cachekeys.h:63: error: invalid use of incomplete type 'struct QString'
    C:\QtSDK\QtSources\4.7.3/src/corelib/global/qglobal.h:1424: error: forward decla
    ration of 'struct QString'
    cachekeys.h:64: error: 'string' was not declared in this scope
    cachekeys.h: In member function 'bool FixStringCacheKey::operator==(const FixStr
    ingCacheKey&) const':
    cachekeys.h:71: error: 'const struct FixStringCacheKey' has no member named 'str
    ing'
    cachekeys.h:71: error: 'string' was not declared in this scope
    cachekeys.h:72: error: 'const struct FixStringCacheKey' has no member named 'pwd
    '
    cachekeys.h:72: error: 'pwd' was not declared in this scope
    cachekeys.h: In member function 'uint FixStringCacheKey::hashCode() const':
    cachekeys.h:76: error: 'string' was not declared in this scope
    cachekeys.h:76: error: 'qHash' was not declared in this scope
    cachekeys.h: At global scope:
    cachekeys.h:86: error: field 'file' has incomplete type
    cachekeys.h:86: error: field 'pwd' has incomplete type
    cachekeys.h: In constructor 'FileInfoCacheKey::FileInfoCacheKey(const QString&)'
    @

    Seems like most errors coming from cachekeys.h, option.h, project.h. Those are just a few of the errors coming up.

    When i build it from QT Creator the errors are
    @
    :-1: warning: D4002 : ignoring unknown option '-Zc:-'
    @

    @
    C:\QtSDK\QtSources\4.7.3\tools\configure-build-desktop..\configure\configure_pch.h:58: error: C1083: Cannot open include file: 'qlist.h': No such file or directory
    @



  • You're not supposed to build configure.exe yourself. It's included in the source package.



  • when does it get executed? why is there a .bat with options then?



  • It's in the main folder of the source package. You just call configure.exe like you would ./configure on linux, with all the appropriate options. If you do not have configure.exe in your source package, may I recommend you to re-download it.



  • That's what i've done. I'm getting those errors from running configure.exe command prompt. I prompt "o" for open source edition then "y" to accept the license then errors spew



  • Ok, sorry, I thought you were trying to build configure yourself (looked like it from the errors you posted).
    Do you have perl in your PATH?



  • This is what i currently have in PATH under system variables
    @
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QT Lite\QTSystem;C:\Program Files\Shoreline Communications\ShoreWare Client;C:\QtSDK\mingw\bin;C:\QtSDK\QtCreator\bin;C:\QtSDK\Desktop\Qt\4.7.3\msvc2008\bin;
    @

    Here is a screen of my "Qt4" and "Tool Chains". I have only VS2003 installed at the moment

    !http://img706.imageshack.us/img706/4585/newpicture6c.png(yep)!

    !http://img12.imageshack.us/img12/6840/newpicture7m.png(sup)!



  • what do i need perl for?





  • if you download the SDK, you can't build qt from there. To build your own qt, you must download the source zip file from "here":http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip and then build it.



  • Alright let me try this out and i'll let you know! thanks again



  • just ran configure and it works like a champ! my next instruction was to "Just run mingw32-make" and now i'm seeing tons of errors after trying to run that. I have perl installed and qt-everywhere-opensource-src-4.7.3

    @
    int, int) const'
    release/main.o:main.cpp:(.text+0x3e0d): undefined reference to QByteArray::oper ator=(QByteArray const&)' release/main.o:main.cpp:(.text+0x3e2a): undefined reference toqFree(void*)'
    release/main.o:main.cpp:(.text+0x3e81): undefined reference to qFree(void*)' release/main.o:main.cpp:(.text+0x3ebf): undefined reference toQHashData::free_
    helper(void ()(QHashData::Node))'
    release/main.o:main.cpp:(.text+0x3ef8): undefined reference to qt_assert_x(char const*, char const*, char const*, int)' release/main.o:main.cpp:(.text+0x3f41): undefined reference toQByteArray::oper
    ator=(QByteArray const&)'
    release/main.o:main.cpp:(.text$_ZN5QListI7QStringE4freeEPN9QListData4DataE[QList
    <QString>::free(QListData::Data*)]+0x34): undefined reference to QString::free( QString::Data*)' release/main.o:main.cpp:(.text$_ZN5QListI7QStringE4freeEPN9QListData4DataE[QList <QString>::free(QListData::Data*)]+0x57): undefined reference toqFree(void*)'
    release/main.o:main.cpp:(.text$_ZN5QListIN12Preprocessor11IncludePathEE4freeEPN9
    QListData4DataE[QListPreprocessor::IncludePath::free(QListData::Data*)]+0x42):
    undefined reference to qFree(void*)' release/main.o:main.cpp:(.text$_ZN5QListIN12Preprocessor11IncludePathEE4freeEPN9 QListData4DataE[QList<Preprocessor::IncludePath>::free(QListData::Data*)]+0x6f): undefined reference toqFree(void*)'
    release/main.o:main.cpp:(.text$ZN5QListIN12Preprocessor11IncludePathEE6appendER
    KS1
    [QListPreprocessor::IncludePath::append(Preprocessor::IncludePath const&)]
    +0x3e): undefined reference to QListData::detach_grow(int*, int)' release/main.o:main.cpp:(.text$_ZN5QListIN12Preprocessor11IncludePathEE6appendER KS1_[QList<Preprocessor::IncludePath>::append(Preprocessor::IncludePath const&)] +0x15f): undefined reference toQListData::append()'
    release/main.o:main.cpp:(.text$_ZN4QMapI10QByteArrayS0_ED1Ev[QMap<QByteArray, QB
    yteArray>::~QMap()]+0x34): undefined reference to QMapData::continueFreeData(in t)' release/main.o:main.cpp:(.text$_ZN4QMapI10QByteArrayS0_ED1Ev[QMap<QByteArray, QB yteArray>::~QMap()]+0x5a): undefined reference toqFree(void*)'
    release/main.o:main.cpp:(.text$_ZN4QMapI10QByteArrayS0_ED1Ev[QMap<QByteArray, QB
    yteArray>::~QMap()]+0x70): undefined reference to qFree(void*)' release/main.o:main.cpp:(.text$_ZN5QListI8ClassDefED1Ev[QList<ClassDef>::~QList( )]+0x6d): undefined reference toqFree(void*)'
    collect2: ld returned 1 exit status
    mingw32-make[2]: *** [......\bin\moc.exe] Error 1
    mingw32-make[2]: Leaving directory C:/QtSDK/QtSources/4.7.3/src/tools/moc' mingw32-make[1]: *** [release] Error 2 mingw32-make[1]: Leaving directoryC:/QtSDK/QtSources/4.7.3/src/tools/moc'
    mingw32-make: *** [sub-moc-make_default-ordered] Error 2

    C:\QtSDK\QtSources\4.7.3>
    @



  • Why do you run mingw-make if you want to build with MSVS 2003?
    MSVS 2003 uses nmake, not mingw-make



  • Yep thats true! I re-ran configure and now it prompted me to use "nmake". It's currently running without errors we'll see what happens when it's done *crosses fingers



  • Alright nmake built correctly! Took a few hours but no errors. Tried to run one of the examples in QT and this is what I'm getting:

    "Direct Link":http://i54.tinypic.com/2ywfvbo.jpg

    !http://i54.tinypic.com/qqvojn.jpg(screenshot)!



  • So, did you add the newly build Qt to the Qt versions of QtCreator? If yes, did you add it for the project (or just delete the pro.user file and reopen the pro project in creator)?



  • I just added it to the "Qt Versions" and that's all i've done.

    !http://i51.tinypic.com/2vjrbyh.jpg(qt)!

    Do i need to do the second thing you mentioned?



  • if you had your qt project before in creator, it uses another qt build.
    So I suggest, close creator, delete teh .pro.user file (or some similar names) and reopen it. Then you are asked, which Qt version to use. Select your msvs 2003 build....



  • Got it working! Thank you very much. I realized I have multiple instances of QT and had a lot of confusion going on.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.