Results 1 to 3 of 3

Thread: MS Visual Studio 6 Problems

  1. #1
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    1

    Default MS Visual Studio 6 Problems

    EDIT: I got it. I had to include the .lib's: C:\qt\4.1.4\*.lib

    I am trying to get QT to work with MS Visual Stuid 6. I ran the installation for QT. I try to do the first tutorial example (hello world), though I am having problems. I need to state to the compiler where the include files are for QT, so in the settings tab, under C/C++ and then under the preprocessor tab....and in the additional include directories I have put: C:\qt\4.1.4\include. I have also needed to change the #include <QApplication> to "qt\QApplication.h".
    Click here for a picture: clicky The same for the other include. I manage to get it to compile but when I link, I get these errors:
    inking...
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QApplication::~QApplication(void)" (__imp_??1QApplication@@UAE@XZ)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QPushButton::~QPushButton(void)" (__imp_??1QPushButton@@UAE@XZ)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static int __cdecl QApplication::exec(void)" (__imp_?exec@QApplication@@SAHXZ)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWidget::show(void)" (__imp_?show@QWidget@@QAEXXZ)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWidget::resize(int,int)" (__imp_?resize@QWidget@@QAEXHH@Z)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString@@QAE@XZ)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QPushButton::QPushButton(class QString const &,class QWidget *)" (__imp_??0QPushButton@@QAE@ABVQString@@PAVQWidget@ @@Z)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (__imp_??0QString@@QAE@PBD@Z)
    main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QApplication::QApplication(int &,char * *)" (__imp_??0QApplication@@QAE@AAHPAPAD@Z)
    libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
    Debug/qtprogram.exe : fatal error LNK1120: 10 unresolved externals
    Error executing link.exe.

    qtprogram.exe - 11 error(s), 0 warning(s)
    So it can't find the libraries for qt. Does anyone know where in MS Visual Studio C++ 6.0 that I can do this? I tried to run the .exe files from the tutorial and it works, but it does not work if I try to compile their code.

    I tried to do the walk through installation and I noticed that the configure command does not work. I assmue it is configured correctly because I ran the installation and qmake seems to work (haven't got that far to use it yet). Nmake doesn't work either.

    Any help would be great.
    Last edited by dayrinni; 22nd August 2006 at 21:08. Reason: Figured it out

  2. #2
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    3
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MS Visual Studio 6 Problems

    Have you link also the [qtmain.lib] library file inside your VC++ environment?

  3. #3
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    497
    Thanked 74 Times in 70 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MS Visual Studio 6 Problems

    Quote Originally Posted by ball
    Have you link also the [qtmain.lib] library file inside your VC++ environment?
    QApplication::QApplication is not in qtmain.lib but in qtgui.

Similar Threads

  1. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  2. Qt 4.1.0 on Visual Studio 2005
    By nErnie in forum Installation and Deployment
    Replies: 8
    Last Post: 6th July 2006, 00:56
  3. Qt Designer & Visual Studio 2005
    By pSiCho in forum Qt Tools
    Replies: 6
    Last Post: 9th February 2006, 13:40
  4. Where does VS save its inviornment vars?
    By high_flyer in forum Installation and Deployment
    Replies: 5
    Last Post: 4th February 2006, 10:10
  5. Visual Studio 2003 and .vcproj files
    By mbjerkne in forum General Discussion
    Replies: 2
    Last Post: 1st February 2006, 00:51

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.