Results 1 to 2 of 2

Thread: Can't get to square 0 on Windows

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Can't get to square 0 on Windows

    I recently downloaded QT for MS Windows from http://www.qtsoftware.com/downloads.

    I've been trying to get a basic "Hello world" program to compile and link and no luck.

    I tried to do the qmake -project; qmake hello.pro thing and couldn't get any usable files.

    So I figured I'd just create a makefile by hand. Well, I'm in linker hell. The link command looks like this:

    link /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86
    /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib"
    /LIBPATH:"c:\Qt\2009.02\qt\lib"
    /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib"
    /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"debug\hello.intermediate.manifest"
    /OUT:hello.exe debug/hello.obj kernel32.lib user32.lib shell32.lib
    uuid.lib ole32.lib advapi32.lib ws2_32.lib gdi32.lib winspool.lib comdlg32.lib
    oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libqtmaind.a libQtGuid4.a libQtCored4.a

    When I run it I get these errors.

    libQtCored4.a(d002026.o) : warning LNK4078: multiple '.text' sections found with different attributes (E0000020)
    hello.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QApplication::~QApplication(void)" (__imp_??1QApplication@@UAE@XZ) referenced in function _main
    hello.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl QApplication::exec(void)" (__imp_?exec@QApplication@@SAHXZ) referenced in function _main
    hello.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWidget::show(void)" (__imp_?show@QWidget@@QAEXXZ) referenced in function _main
    hello.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl QObject::connect(class QObject const *,char const *,class QObject const *,char const *,enum Qt::ConnectionType)" (__imp_?connect@QObject@@SA_NPBV1@PBD01W4Connectio nType@Qt@@@Z) referenced in function _main
    hello.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) char const * __cdecl qFlagLocation(char const *)" (__imp_?qFlagLocation@@YAPBDPBD@Z) referenced in function _main
    hello.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString@@QAE@XZ) referenced in function _main
    etc.

    None of the QT functions are found despite my including libqtmaind.a, libQtGuid4.a, and libQtCored4.a.

    And there is that ominous warning about multiple '.text' sections found with different attributes in libQtCored4.a.

    When I did a search on that warning there was something about GNU C libraries not being recognized by the Windows linker.

    Is there any way to compile and link QT with the Windows cl compiler?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't get to square 0 on Windows

    Did you download the SDK or source code ? If u downloaded SDK, its compiled with mingW and wont be usable with Visual studio as far as I guess.

    For running an application on windows follow these steps -
    1) qmake -project --- this will generate .pro
    2) Modify .pro as per ur needs
    3) qmake -tp vc --- this will create a .vcproj file which you can open in Visual Studio
    4) build / compile from VS.

    Make sure you are including headers in ur application and Qt bin directory is included in ur PATH

Similar Threads

  1. Qt Jambi, deploying app on Mac & Windows fails
    By ChrisColon in forum Installation and Deployment
    Replies: 2
    Last Post: 16th February 2009, 22:05
  2. Replies: 5
    Last Post: 15th January 2009, 09:03
  3. Opening text file fails after autostartup on windows
    By yogourta in forum Qt Programming
    Replies: 2
    Last Post: 18th October 2008, 03:52
  4. Windows not appearing in XP.
    By beardybloke in forum Qt Programming
    Replies: 7
    Last Post: 24th October 2007, 17:32
  5. Replies: 8
    Last Post: 2nd August 2006, 16:19

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.