473,699 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiling QT program with VS6

9 New Member
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\Syst em32 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(dll import) public: virtual __thiscall QApplication::~ QApplication(vo id)" (__imp_??1QAppl ication@@UAE@XZ )
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: virtual __thiscall QPushButton::~Q PushButton(void )" (__imp_??1QPush Button@@UAE@XZ)
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: static int __cdecl QApplication::e xec(void)" (__imp_?exec@QA pplication@@SAH XZ)
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: void __thiscall QWidget::show(v oid)" (__imp_?show@QW idget@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: void __thiscall QWidget::resize (int,int)" (__imp_?resize@ QWidget@@QAEXHH @Z)
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: __thiscall QString::~QStri ng(void)" (__imp_??1QStri ng@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: __thiscall QPushButton::QP ushButton(class QString const &,class QWidget *)" (__imp_??0QPush Button@@QAE@ABV QString@@PAVQWi dget@@@Z)
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: __thiscall QString::QStrin g(char const *)" (__imp_??0QStri ng@@QAE@PBD@Z)
main.obj : error LNK2001: unresolved external symbol "__declspec(dll import) public: __thiscall QApplication::Q Application(int &,char * *,int)" (__imp_??0QAppl ication@@QAE@AA HPAPADH@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.or g/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 3819
Banfa
9,065 Recognized Expert Moderator Expert
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
Jan Spatina
9 New Member
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 Recognized Expert Moderator Expert
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
Jan Spatina
9 New Member
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
4676
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 DLL's etc - it compiles to a single EXE. The program runs fine on my computer under Windows 2000 Professional and a few other machines that I have tried including two running Windows XP. Should the same code work on all versions of windows...
0
1695
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 compiled into native machine code (albeit with a lot of extra effort). For instance, type information is discovered when something is assigned to a variable or an anonymous piece of data is used in a program. Compiling Python bytecode into native...
2
2118
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 my other includes then I get lots of errors like C2011: 'fd_set' : 'struct' type redefinition warning C4005: 'FD_CLR' : macro redefinition which I understand are due to the fact that windows.h is being included in another header file as well as...
1
1904
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 arrise. It has been suggested to me that I should use the following pattern when compiling my programs, but I am not sure I understand the "pattern", Try creating a text file along the following lines where the /r are the dlls you are...
0
1747
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 .bmp files in the same folder as the script. I run my .py script (from IDLE) and all the backgrounds are loaded as intended. in my script I load the images like this:
1
3063
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 C4346: '_It::iterator_category' : dependent name is not a type prefix with 'typename' to indicate a type c:\Program Files\Microsoft Visual Studio\VC98\Include\UTILITY(84) : see reference to class template instantiation...
2
1976
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
11284
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 basic compiling on this new Dev C++, when i try to print something like: #include<iostream.h> using namespace std; int main () { cout << "Hello to the world" << endl; system("PAUSE") return 0;
1
3924
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 issue. I am using Visual Basic 2005 (express). I got shellapi.h from the platform sdk. Thanks for any help. here is my error log 1>------ Build started: Project: openFile, Configuration: Debug Win32 ------
10
2202
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 works fine". Now admittedly, I tend to have a phobia of this situation because I recall from my Windows days the numerous times I was given code that was supposedly "good to go", but which failed to compile for some stupid reason. Of course I...
0
8686
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8911
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7748
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6533
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.