LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-24-2006, 11:54 AM   #1
creolophus
Member
 
Registered: Nov 2005
Posts: 34

Rep: Reputation: 15
Qt program: compile error


Hi,

I have been trying to learn Qt on a Windows XP system and to do that I downloaded MingW C++ compiler and a few other MingW packages.

Then I installed the Qt4 OpenSource Edition and installed it with MingW compiler

then, when I try to compile a "hello world!" program, I am getting errors which I am not able to understand


what I did is this,

create a directory called "hello" and inside it, put a file called "hello.cpp"
Code:
/* 
    hello.cpp 
*/


#include <QApplication>
#include <QPushButton>

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

    QPushButton hello("Hello world!");
    hello.resize(100, 30);

    hello.show();
    return app.exec();
}
The following are the commands that I executed and the messages that were displayed

Code:
F:\cpp\hello>qmake -project

F:\cpp\hello>qmake

F:\cpp\hello>make
make.exe -f Makefile.Debug
make.exe[1]: Entering directory `/f/cpp/hello'
g++ -c -g -g -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL
 -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"E:/Qt/4.1.4/
include/QtCore" -I"E:/Qt/4.1.4/include/QtGui" -I"E:/Qt/4.1.4/include" -I"." -I"E
:/Qt/4.1.4/include/ActiveQt" -I"debug" -I"." -I"e:\Qt\4.1.4\mkspecs\win32-g++" -
o debug\hello.o hello.cpp
g++.exe: no input files
make.exe[1]: *** [debug\hello.o] Error 1
make.exe[1]: Leaving directory `/f/cpp/hello'
make.exe: *** [debug] Error 2

F:\cpp\hello>

Please tell me what is wrong and how I should fix it


Thank you very much
 
Old 08-24-2006, 12:21 PM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
did you take a look at the project file that was generated and make sure it looks ok?
 
Old 08-24-2006, 02:53 PM   #3
creolophus
Member
 
Registered: Nov 2005
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by xhi
did you take a look at the project file that was generated and make sure it looks ok?
Here is the project file, "hello.pro"
Code:
######################################################################
# Automatically generated by qmake (2.00a) Thu Aug 24 22:27:06 2006
######################################################################

TEMPLATE = app
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .

# Input
SOURCES += hello.cpp

is that ok?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error in practice program BobNutfield Programming 4 02-15-2006 02:48 PM
configure: error: Can't find "javac" in your PATH, when install/compile a program... JungMin Programming 5 12-07-2005 05:04 PM
configure: error: Can't find "javac" in your PATH, when install/compile a program... JungMin Linux - Software 4 12-05-2005 11:20 PM
c program : compile/link error h/w Programming 2 10-06-2003 09:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration