PDA

View Full Version : Trying to "Hello World" from Qt + VC7 .Net 2003



kahahn
15th June 2009, 22:23
I installed Qt for windows from the latest download available at Trolltech. I have VC7 2003 .NET installed on my PC. I ran the configuration with the appropriate path settings and

QMAKESPEC=win32-mscv2003

configure.exe -release -no-dsp -vcproj

Then I tried to compile

#include <qapplication.h>
#include <qpushbutton.h>


int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QPushButton hello("Hello world!");

hello.show();
return app.exec();
}

by doing

qmake -project
qmake
nmake

Compile happens w/o error, but I get the following linker message:

LNK1182: cannot open input file 'c:\qt\2009.02\qt\lib\qtmain

Clearly I didn't configure my Qt correctly for .NET 2003. Can anybody provide me the correct configuration sequence for what I'm trying to do? Thanks.

Karl

Lykurg
15th June 2009, 22:38
Instead of
#include <qapplication.h>
#include <qpushbutton.h> try
#include <QApplication>
#include <QPushButton>

Lesiok
16th June 2009, 07:05
Did You rebuild Qt qith Visual C++ ?

kahahn
16th June 2009, 14:40
Thank you for the suggestions. I tried using

#include <qapplication>
#include <qpushbutton>


... that is, getting rid of the ".h". I got the same result.

Originally when I did the "configure.exe ..." I ran the following setup.bat file first:

path=C:\WINNT\system32;C:\WINNT;\C:\WINNT\System32 \Wbem;C:\Program Files\Common Files\GTK\2.0\bin\C:\CARIS\EASY-ENC\Bin;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin;C:\Qt\2009.02\qt\bin
set QMAKESPEC=win32-msvc2003
vcvars32

When I show the path after doing this, it shows a bunch of paths into the MS .NET 2003 installation, including the correct path for the correct c++ compiler.

The configure process ran about 2 hours and completed without error.

I suspect there is another operation I need to do to build the missing library, but I don't know what the command line is for that. So I am still in search of a clue.

Karl

kahahn
17th June 2009, 13:49
I finally got it to work. :) I had to re-install on an XP PC (the one I was trying where the library was missing was Windows 2000). When I tried a reinstall on Windows 2000, I found that the library build was not completing -- it was encountering a quota problem.

So I'm in business now. :cool: Just wish it hadn't taken several days when I could have been developing my app.

Karl