Results 1 to 10 of 10

Thread: Qt 4.3.2 with VS 2005 Express

  1. #1
    Join Date
    May 2006
    Location
    Stuttgart, Germany
    Posts
    22
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt 4.3.2 with VS 2005 Express

    Hello,

    yesterday I compiled Qt 4.3.2 with Visual Studio 2005 Express Edition (german). After configuring without needed patch in QTDIR:
    configure
    and compiling
    nmake
    I set environment variables in a special batch file like this:
    set QTDIR = D:\Programme\Qt\4.3.2
    set PATH=%PATH;D:\Programme\Qt\4.3.2\bin
    set QMAKESPEC = win32-msvc2005
    I have a project that consists of several subdirectories containing libraries/dll projects using pro-templates of
    vclib
    or
    vcapp
    and one subdir containing application, I use the
    SUBDIRS
    template in main dir of project. I have a Qt pro file like this in the subdirs:

    TEMPLATE = vclib
    #TEMPLATE = lib
    LANGUAGE = C++
    VERSION = 1.0.0.2

    CONFIG(debug, debug|release) {
    TARGET = Libd
    DEFINES += QT_DEBUG
    CONFIG += console
    } else {
    TARGET = Lib
    }

    INCLUDEPATH = \
    ../debug \

    SOURCES += \
    [... skipped ...]

    HEADERS += \
    [ ... skipped ]

    QT -= gui
    CONFIG += dll qt warn_on debug_and_release
    DEFINES += BUILD_LIB
    When I generate my vcproj file with
    qmake -tp vc
    in the subdirs I get vcproj files with names of the debug target name (Libd) of library/app, which was not so in Qt 4.3.1

    I generate the main solutions file in main dir with
    qmake -tp vc -r main.pro
    which generates a main dir solutions file (main.sln)


    Another thing is when loading these project files or the solutions file of subdirs project I get a raised warning level with messages like
    TPXModel.cpp(14) : warning C4100: 'qName': Unreferenzierter formaler Parameter
    meaning a local parameter is not referenced in function or

    .\MainWindow.cpp(9) : warning C4189: 'view': Lokale Variable ist initialisiert aber nicht referenziert
    meaning a local variable is initialised but not referenced in function.

    and when linking I get another new warning:

    LINK : warning LNK4068: /MACHINE nicht angegeben ; Standardwert X86
    meaning that I have to specify /MACHINE parameter when linking my project, that was never true for Qt < 4.3.2

    Any hints on this are very well appreciated, I'll have to stick to 4.3.1 until this has been resolved.

    Thx
    AlGaN

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    I don't see any problems here
    debug_and_release creates debug libs with 'd' postfix. The rest are just compiler warnings because of your code. The missing /MACHINE in the link line is superflous since it defaults to x86.

  3. #3
    Join Date
    May 2006
    Location
    Stuttgart, Germany
    Posts
    22
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    Hello Christian,

    thanks for your reply.

    There are no problems in compiling/linking the project, but these warnings are for me at least annoying because they weren't existent in former Qt releases (< Qt 4.3.2).
    By configuring/compiling Qt 4.3.2 with configure/nmake there must have been a silent change in configuration or qmake's newest build changes this when generating the vcproj-Files of the project. The question is: Why?

    Another thing is, my colleague has not this change, in his installation of Qt 4.3.2 there have been no changes in configuration and he doesn't see any warnings when compiling the same code...

    So my only conclusion is that I have made a mistake when building this release of Qt 4.3.2.

    Can anybody confirm that Qt 4.3.2 could be built on Windows XP with Visual Studio 2005 Express just by typing
    configure
    and
    nmake
    in Qt installation dir without applying any patch for the opensource version?

    Thanks for any hints.

  4. #4
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    since 4.3.2 you don't need the patch anymore. That's also why the behaviour of qmake changed a little bit.

  5. #5
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    It depends on whether you've got QMAKESPEC set to your default compiler platform. Its worth using
    Qt Code:
    1. configure -platform win32-msvc2005
    To copy to clipboard, switch view to plain text mode 
    to make sure. I put all my versions in in a folder like F:\Qt\4.3.2 and now I've got a single batch file called builldqt.bat which is at F:\Qt. Its got all my options in and looks like.
    Qt Code:
    1. cd %1
    2. call vsvars2005.bat
    3. call "%DXSDK_DIR%\Utilities\Bin\dx_setenv.cmd"
    4. configure -platform win32-msvc2005 -openssl -stl -accessibility -debug-and-release
    5. -shared -no-fast -qt-sql-odbc -rtti -qt-gif -vcproj -qt-zlib -qt-libmng
    6. -qt-libpng -qt-gif -qt-libtiff
    7. -qt-libjpeg -direct3d -arch windows -I F:\OpenSSL\include -L F:\OpenSSL\lib
    8. nmake
    9. :End
    10. echo Done
    11. pause
    To copy to clipboard, switch view to plain text mode 
    So now I can explode a new version from the tar/zip into the folder, open a command prompt to F:\Qt and run, say
    Qt Code:
    1. buldqt 4.3.2
    To copy to clipboard, switch view to plain text mode 

    p.s. the vsvars2005.bat is my own environment set up for the compile - based on vsvars32.bat. I hope you get the idea.

    Pete

  6. #6
    Join Date
    May 2006
    Location
    Stuttgart, Germany
    Posts
    22
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    Hello pdolbey,

    thanks for your reply & suggestions.
    I tried to set QMAKESPEC before compiling via
    configure -platform win32-msvc2005
    but it didn't change the result, same problems when trying to generate vcproj files after qmake & other tools were built in bin directory.

    I compared my vcvars32.bat file of VC Express with the one of my colleague but there aren't any differences in environment settings, there are only include/lib directories of VC Express installation and integrated Platform SDK.

    I tried to start VC Express command line and thereafter changing to Platform SDK directory and executing
    sentenv.cmd
    of the Platform SDK but this changes nothing in build process.

    One thing I haven't understood yet in qmake's build process is behaviour of template parameters. When specifying
    TEMPLATE=vclib
    in qmake's pro file and running
    qmake
    therafter, is that the same as specifying
    TEMPLATE=lib
    in pro file and executing
    qmake -t vclib
    or
    qmake -tp vc
    ?

    If anybody has any more hints on this strange behaviour of qmake I'd very appreciate that.

  7. #7
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    I really can't see what problems you have...

    normally you only use
    "template=app" in your pro-File to be platform independent and select the vcapp template with "qmake -tp vc"

  8. #8
    Join Date
    May 2006
    Location
    Stuttgart, Germany
    Posts
    22
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    Hello Christian,

    from
    qmake --help
    -t templ Overrides TEMPLATE as templ
    -tp prefix Overrides TEMPLATE so that prefix is prefixed into the value
    together with QtAssistant qmake docs I suppose that -t parameter overrides specified TEMPLATE in pro file to value templ whereas -tp prefixes vc before specified value in TEMPLATE variable in pro file, i.e.
    TEMPLATE=lib
    in pro file and executing
    qmake -tp vc
    gives
    TEMPLATE=vclib
    meaning the same as overriding specified template in pro file with
    qmake -t vclib

    I compared the vcproj files generated with qmake of Qt 4.3.1 with that one of qmake of Qt 4.3.2 and there seems to be a change in command line parameters in custom build step when moc is executed. Comparing

    <FileConfiguration
    Name="Release|Win32">
    <Tool
    Name="VCCustomBuildTool"
    AdditionalDependencies="${QMAKE_FUNC_mocCmd}"
    CommandLine="d:\Programme\Qt\4.3.1\bin\moc.exe -DNDEBUG -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DBUILD_MOTIONTRACKER -DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I &quot;d:\Programme\Qt\4.3.1\include\QtCore&quot ; -I &quot;d:\Programme\Qt\4.3.1\include\QtCore&quot ; -I &quot;d:\Programme\Qt\4.3.1\include&quot; -I &quot;..\common\debuq&quot; -I &quot;..\common\vecmat3d&quot; -I &quot;..\common\mtcomm&quot; -I &quot;d:\Programme\Qt\4.3.1\include\ActiveQt&qu ot; -I &quot;release&quot; -I &quot;.&quot; -I&quot;d:\Programme\Qt\4.3.1\mkspecs\win32-msvc2005&quot; Project1.hpp -o release\moc_Project1.cpp"
    Description="MOC Project1.hpp"
    Outputs="release\moc_Project1.cpp"/>
    </FileConfiguration>
    from generated vcproj with 4.3.1 and
    <FileConfiguration
    Name="Release|Win32">
    <Tool
    Name="VCCustomBuildTool"
    AdditionalDependencies="D:\Programme\Qt\4.3.2\bin\ moc.exe;Project1.hpp"
    CommandLine="D:\Programme\Qt\4.3.2\bin\moc.exe -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DBUILD_MOTIONTRACKER -DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I&quot;d:\Programme\Qt\4.3.2\include\QtCore&quot ; -I&quot;d:\Programme\Qt\4.3.2\include\QtCore&quot ; -I&quot;d:\Programme\Qt\4.3.2\include&quot; -I&quot;..\common\debuq&quot; -I&quot;..\common\vecmat3d&quot; -I&quot;..\common\mtcomm&quot; -I&quot;d:\Programme\Qt\4.3.2\include\ActiveQt&quot ; -I&quot;release&quot; -I&quot;.&quot; -Id:\Programme\Qt\4.3.2\mkspecs\win32-msvc2005 -D_MSC_VER=1400 -DWIN32 Project1.hpp -o release\moc_Project1.cpp"
    Description="MOC Project1.hpp"
    Outputs="release\moc_Project1.cpp"
    Path="d:\Programme\Qt\4.3.2\bin"/>
    </FileConfiguration>
    from generated vcproj of Qt 4.3.2 one recognizes that qmake in new version doesn't define
    -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
    anymore resulting in these warnings I get when compiling...

    I don't understand why qmake does these changes in my installation and not in the installation of my working colleague.

  9. #9
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    Maybe you don't read my posts or maybe you're using the commercial edition for 4.3.x and therfore did not use the acs patch but
    since 4.3.2 you don't need the patch anymore. That's also why the behaviour of qmake changed a little bit.
    explains your 'problem'

    the '-t?' command line options behave exactly like you wrote - but I did not say anything else.

  10. #10
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.2 with VS 2005 Express

    I'm going to try to stay in diagnostics mode, rather than solutions mode.

    All the differences you are describing are driven by the "qmake.conf" file for your platform. You should find this file in %QTDIR%\mkspecs\win32-msvc2005, where %QTDIR% should point to your Qt 4.3.2 installation.

    Compare the files on your's and your colleague's machines, then report back here.

    Pete

Similar Threads

  1. Problem installing Qt 4.2.3 with MSVC 2005 express edition
    By jjhenjj in forum Installation and Deployment
    Replies: 8
    Last Post: 12th July 2007, 13:57

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
  •  
Qt is a trademark of The Qt Company.