Skip to content

Latest commit

 

History

History
131 lines (74 loc) · 5.37 KB

CppHelloCpp11QtCreatorLubuntuToWindows.md

File metadata and controls

131 lines (74 loc) · 5.37 KB

 

 

 

 

 

 

C++11Qt CreatorLubuntuToWindows

 

Hello C++11 using Qt Creator under Lubuntu, crosscompiled to Windows is a Hello C++11 program.

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

  • Qt Qt: version 5.4.1 (32 bit)
  • STL STL: GNU ISO C++ Library, version 4.9.2

 

 

 

 

 

Qt project file: ./CppHelloCpp11QtCreatorLubuntuToWindows/CppHelloCpp11QtCreatorLubuntuToWindows.pro

 


QT       += core QT       -= gui QMAKE_CXXFLAGS += -std=c++11 CONFIG   += console CONFIG   -= app_bundle TEMPLATE = app SOURCES += main.cpp

 

 

 

 

 

./CppHelloCpp11QtCreatorLubuntuToWindows/main.cpp

 


#include <iostream> int main() {   const auto s = "Hello C++11";   std::cout << s << '\n'; }

 

 

 

 

 

./CppHelloCpp11QtCreatorLubuntuToWindows/CppHelloCpp11QtCreatorLubuntuToWindows.sh

 


#!/bin/bash #From http://richelbilderbeek.nl/CppHelloCpp11QtCreatorLubuntuToWindows.htm echo "Cross compiling to Windows" myfile="i686-pc-mingw32-qmake" #myfile="../../Libraries/mxe/usr/bin/i686-pc-mingw32-qmake" mytarget="CppHelloCpp11QtCreatorLubuntuToWindows" myprofile=$mytarget.pro if [ -e $myfile ] then   echo "MXE crosscompiler '$myfile' found" else   echo "MXE crosscompiler '$myfile' not found"   #exit fi if [ -e $myprofile ] then   echo "Qt Creator project '$myprofile' found" else   echo "Qt Creator project '$myprofile' not found"   exit fi echo "1/2: Creating Windows makefile" $myfile $myprofile if [ -e Makefile ] then   echo "Makefile created successfully" else   echo "FAIL: $myfile $myprofile"   exit fi echo "2/2: making makefile" make if [ -e ./release/$mytarget.exe ] then   echo "SUCCESS" else   echo "FAIL" fi #Cleaning up rm Makefile rm Makefile.* rm -r release rm -r debug