Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Qt CreatorCygwinWindows Hello World using Qt Creator under Cygwin (under Windows)

 

Hello World (or 'The Hello World program') is a standard example program to see if your programming environment works. Note that this example code is not standarized, so multiple and similar variants are on the Internet. A more demanding example is Hello Boost, which also tests if the Boost libraries are installed correctly.

 

 

The (C++) code of Hello World is as follows:

 

#include <iostream>

int main()
{
  std::cout << "Hello World\n";
}

 

Under Cygwin use the following command to produce a makefile:

 

qmake-qt4

 

Making the makefile:

 

make

 

Results in the screen output:

 

g++-4  -o CppHelloWorldQtCreatorCygwin.exe main.o    -L/usr/lib/qt4/lib -lQtCore -L/usr/lib/qt4/lib -lz -lm -lgthread-2.0 -lglib-2.0 -lintl -liconv -ldl -lpthread

 

 

 

 

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: CppHelloWorldQtCreatorCygwin.pro

 

#-------------------------------------------------
#
# Project created by QtCreator 2010-09-29T14:58:49
#
#-------------------------------------------------
QT       += core
QT       -= gui
TARGET = CppHelloWorldQtCreatorCygwin
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
SOURCES += main.cpp

 

 

 

 

 

main.cpp

 

#include <iostream>

int main()
{
  std::cout << "Hello World\n";
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict