PDA

View Full Version : MS Visual Studio 6 Problems



dayrinni
22nd August 2006, 21:45
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 (http://www.tempestseason.com/images/qtpic1.jpg) 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.

ball
23rd August 2006, 04:07
Have you link also the [qtmain.lib] library file inside your VC++ environment?

ChristianEhrlicher
23rd August 2006, 07:59
Have you link also the [qtmain.lib] library file inside your VC++ environment?
QApplication::QApplication is not in qtmain.lib but in qtgui.