473,324 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Compiling QT program with VS6

Hi,
I've got problems when trying to compile simple hello world program in vs6 using
qt3.4.0.
it's code is:

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

int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
hello.show();
return a.exec();
}

As written in the manual, I've set env variables like this:
QTDIR set to C:\Qt\4.3.0, PATH set to C:\Qt\4.3.0\bin, C:\MinGW\bin to PATH, D:\WINDOWS\System32 to PATH, QMAKESPEC set to win32-g++.

In vs6 I've set all library and include paths.

But build goes to errors (compilation is ok).

Linking...
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 * *,int)" (__imp_??0QApplication@@QAE@AAHPAPADH@Z)
Release/main.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.

What does this error mean, and how to fix it?
The same problem has allready been solved here: http://www.qtcentre.org/forum/f-installation-5/t-ms-visual-studio-6-problems-3388.html , but without a good conclusion.

If you had some ideas to help, it would be good.
thanks
-jan
Jul 31 '07 #1
4 3799
Banfa
9,065 Expert Mod 8TB
I imagine that Qt whatever it is comes with some libraries (qt.lib??) and it appears that you have not included these as inputs to you linker.

Open the project settings, goto the Linker tab and add the additional libraries you require that contain the binary code for these classes.
Jul 31 '07 #2
There are no lib's in my installation. There only *.a and *.prl files. I am not sure if they can be somehow linked to VS?

-jan
Aug 1 '07 #3
Banfa
9,065 Expert Mod 8TB
There are no lib's in my installation. There only *.a and *.prl files. I am not sure if they can be somehow linked to VS?

-jan
OK well .a is a common extension for libraries on any non Windows system so it might be that, however there will either be some binary libraries as part of the install somewhere or there will be cpp files that contain the implementation of the classes that you can compile.

You should check the package documentation.

The .prl file is most likely a perl file to perform some function.


Given the existence of a .a file are you sure that this package was realsed to work on the Windows platform?
Aug 1 '07 #4
Thanks Banfa, you were right. Problem was in wrong versing of QT installed. It was "open source version". I reinstalled to "Academic/research" and now everything works fine.
Aug 2 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: smjmitchell | last post by:
Hi All, I have written a program in VB 6.0 that I would like to distribute to many users (most likely via freeware / shareware). The program is a relatively simple and does not call any external...
0
by: Johnathan Doe | last post by:
I've been thinking about what the issues would be in compiling Python into native machine code, and since type information is important in Python, it seems possible that Python code can be...
2
by: Erik | last post by:
Hi Everyone, I'm having real problems compiling some source for eVC4++. The errors I am getting are below: It all seems to be centred around winsock. If I move the afsock.h reference to before...
1
by: Jim Heavey | last post by:
Hello, trying to round out my knowlege here about compiling. To date I have used VS.Net to do all my compiling "majically", but I want to understand how to do it on my own, should the need ever...
0
by: erkidevries | last post by:
Problem compiling Tkinter program with bmp images (using py2exe) I have a Tkinter gui program that uses bmp as backgrounds. The program itself works when I run from the source. I placed the...
1
by: Riaan | last post by:
I am compiling my app (including CODEBASE database headers) but as soon as i compile it gives me the following errors : c:\Program Files\Microsoft Visual Studio\VC98\Include\UTILITY(81) : warning...
2
by: stevenruiz | last post by:
Hi Everyone, The Strings.h has the function Get_Line which is defined and the error is shown below: Strings.h: void get_line( istream & );
2
by: renagade629 | last post by:
Can anybody help me understand what i'm doing wrong or what I'm missing? Is there anyother good and commendable C++ program I can use (free) from the internet like Dev C++? I'm having trouble doing...
1
by: jon2211 | last post by:
I tried to compile some code with #include <shellapi.h. I am linking shell32.lib. I am not trying to use ShellExecute() but right now just getting the code to compile with the header file an...
10
by: Tomás Ó hÉilidhe | last post by:
I'd post this on a gcc newsgroup but I'd be more productive talking to the wall. Anyway, let's say someone throws some source code at you for a particular program and says, "Just compile it, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.