Results 1 to 17 of 17

Thread: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

  1. #1
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Hi,

    I'm trying to get Qt 4.3.3 to work with MS Visual Studio 2005 Express on a Windows Vista 64bit machine. I know I could use Mingw and Eclipse, but I need Visual Studio for another C++ library.

    I have installed Visual Studio and Qt 4.3.3 (well unzipped qt-win-opensource-src-4.3.3), I added the bin directory of Qt to the PATH. I opened the Visual Studio 2005 Command Prompt and went to the Qt directory. According to different wikis I read I don't need any patching and I should enter the command: configure -platform win32-msvc2005 . But that doesn't work, I get the error:

    C:\Qt\4.3.3>configure -platform win32-msvc2005
    Invalid option "win32-msvc2005" for -platform.
    See the README file for a list of supported operating systems and compilers.
    Usage: configure [-buildkey <key>]
    ....
    Already tried different other combinations, but non of them worked. Thought the installation process would be the easiest one Hope someone can help me. Thanks.

    Kind regards,

    Nick
    Last edited by jpn; 16th January 2008 at 10:41. Reason: reformatted to look better

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    What happens if you don't pass the platform option at all (run "configure" with no options)? With a bit of luck your VS should be detected automatically.

  3. #3
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Nope, doesn't work either. Just running configure without any options gives me:

    C:\Qt\4.3.3>configure
    Unable to detect the platform from environment. Use -platform command lineargument or set the QMAKESPEC environment variable and run configure again
    See the README file for a list of supported operating systems and compilers.
    It says to set QMAKESPEC, to what should I set it?

    Kind regards,

    Nick
    Last edited by jpn; 16th January 2008 at 10:40. Reason: reformatted to look better

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Quote Originally Posted by nicksnels View Post
    It says to set QMAKESPEC, to what should I set it?
    win32-msvc.net

    BTW. Looks like you simply forgot the dot between "msvc" and "net". Try adding it, it should work just fine.

  5. #5
    Join Date
    Nov 2007
    Posts
    89
    Thanked 21 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Quote Originally Posted by wysota View Post
    win32-msvc.net
    But he says he use MSVC express 2005, so it should be win32-msvc2005.

    I too use MVCS Express 2005* on Vista 64, and I got no problem installing Qt. Maybe the extraction went wrong, check if exists a 'mkspecs' directory in %QTDIR%, and if it contains a 'win32-msvc2005' directory. Try also to redownload qt source package.

    * Actually I'm using 2008 version, but it worked also when I used 2005.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Hmm... right... I have to stop answering questions at 1am... I use 2005 myself, but with a 32 bit system.

  7. #7
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Thanks for all the replies. Managed to get a bit further. I redownloaded the sources as I was missing quite a few things. Also installed a MS SDK according to the information provided by http://kjell.hedstrom.googlepages.co...o_express_2005 . I set QTDIR (c:\Qt\4.3.3),QMAKESPEC (win32-msvc2005) and added the Qt bin directory to the PATH and ran configure - prefix c:\Qt4.3.3 . It runs for a while and compiles things and after a while a get:

    Creating qmake...

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
    Copyright (C) Microsoft Corporation. All rights reserved.

    Creating makefiles in src...
    Generating Visual Studio project files...
    Could not find mkspecs for your QMAKESPEC(win32-msvc2005) after trying:
    c:\Qt4.3.3\mkspecs
    Error processing project file: C:/Qt/4.3.3/projects.pro
    Qmake failed, return code 3

    Generating Makefiles...
    Could not find mkspecs for your QMAKESPEC(win32-msvc2005) after trying:
    c:\Qt4.3.3\mkspecs
    Error processing project file: C:/Qt/4.3.3/projects.pro
    Qmake failed, return code 3
    And then it stops. Any ideas what may be causing this? I have a folder win32-msvc2005 in c:\Qt\4.3.3\mkspecs and it has two files qmake.conf and qplatformdefs.h . Thanks.

    Kind regards,

    Nick
    Last edited by jpn; 16th January 2008 at 10:40. Reason: missing [quote] tags

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Skip the prefix. If you want the prefix, issue "make install_mkspecs" after qmake complains. It should then install the specs to the specified directory and when you restart the configuration process it should work fine. Of course you can also copy the mkspecs directory to the one pointed to by the prefix yourself.

  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: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    The install prefix is really a problem - afaik it's not officially supported on windows. I've had several problems because some libs were not installed into <install_prefix>/bin. The latest one was that qttest(d)4.dll is not copied into there. This will be fixed in 4.3.4 or 4.4.0

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    The problem (I also remember encountering it) is that on Windows mkspecs need to be in the prefixed directory for qmake to work even before Qt is compiled. Amazingly this is not an issue on Unix systems.

  11. #11
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    So, I have just run configure without any options, but I get the same output. Is there a way to clean the output/result of the first configure I ran? Or should I just delete everything in the Qt folder and start all over again? Thanks.

    Kind regards,

    Nick

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Try "nmake confclean" or "nmake distclean".

  13. #13
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Hi,

    removed everything and started from scratched. Now if I run configure and nmake everything works. So far for the good news. I also need Postgresql support, which is done with configure -plugin-sql-psql . Which works, but when I run nmake, after a couple of minutes I get:

    cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189
    -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FRO
    M_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I".
    .\..\..\..\include\QtCore" -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include
    \QtSql" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\Qt\4.3.3\inc
    lude\ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"..\..\..\..\mkspecs\win32-msvc2
    005" -Fotmp\obj\debug_shared\ @C:\Users\SONATA~1\AppData\Local\Temp\nm14A0.tmp
    moc_qsql_psql.cpp
    link /LIBPATH:"c:\Qt\4.3.3\lib" /LIBPATH:"c:\Qt\4.3.3\lib" /NOLOGO /DEBU
    G /DLL /MANIFESTFILE:"tmp\obj\debug_shared\qsqlpsqld.inter mediate.manifest" /VER
    SION:4.33 /OUT:..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll @C:\Users\SONATA~1\
    AppData\Local\Temp\nm1720.tmp
    LINK : fatal error LNK1104: cannot open file 'libpq.lib'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 2005
    \VC\BIN\link.EXE"' : return code '0x450'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 2005
    \VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    I have already installed Postgresql 8.2.6 and unzipped the binaries to c:\pgsql. I added the necessary items to my environment as described on http://trolltech.com/developer/knowl...28.7933143318/ . As always, all help is really appreciated.

    Kind regards,

    Nick
    Last edited by jpn; 18th January 2008 at 06:53. Reason: missing [quote] tags

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Did you set the proper environment variables? Does "echo %LIB%" return C:\pgsql\lib (or similar) among the entries?

  15. #15
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Hi,

    I double checked everything, and the environment variables are all set as described on the Qt website.

    I restarted from scratch, unzipped the source, ran configure -plugin-sql-psql and nmake and I get the same error as I mentioned in my last post. It says it can't find libpq.lib and thats because I don't have it. I only have libpq.a and libpq.dll in c:\pgsql\lib . All tips are welcome Thanks.

    Kind regards,

    Nick

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Then you have PostgreSQL libraries built for MinGW and not MSVC. You need to get a copy built for MSVC.

  17. The following user says thank you to wysota for this useful post:

    nicksnels (18th January 2008)

  18. #17
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem getting Qt 4.3.3 to work with MS Visual Studio 2005 Express

    Ok, I managed to get it compiled without any errors Thank you to everybody who helped me. Especially wysota, thanks for sticking out with me, couldn't have done it without your help!

    For those of you who might get the same errors. The Postgresql files you need are included with the standard Windows installer. You only need to make sure to also install the Development option (they are all the way down the bottom of the installation options). You also need to add the following environment variables:

    INCLUDE: C:\Program Files\PostgreSQL\8.2\include
    LIB: C:\Program Files\PostgreSQL\8.2\lib;C:\Program Files\PostgreSQL\8.2\lib\ms (NOTE: I had to add the lib\ms directory otherwise nmake couldn't find libpq.lib which is located in that directory)
    PATH: C:\Program Files\PostgreSQL\8.2\bin

    That basically is it. It's not that hard, it only took me a couple of days to figure it out. And compilation takes a really long time Now I can finally start on my first project, so I'll be back

    Kind regards,

    Nick

Similar Threads

  1. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  2. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  3. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  5. Qt Designer & Visual Studio 2005
    By pSiCho in forum Qt Tools
    Replies: 6
    Last Post: 9th February 2006, 13:40

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.