(C++) HelloBoostRegexQt5QtCreatorLubuntuToWindows

January 17, 2018 · View on GitHub

BoostQt5Qt
CreatorLubuntuToWindows

Hello Boost.Regex using Qt5 under Qt Creator under Lubuntu, crosscompiled to Windows is a Hello Boost.Regex program.

Technical facts

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

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

 

 

 

 

 

Qt project file: ./CppHelloBoostRegexQt5QtCreatorLubuntuToWindows/CppHelloBoostRegexQt5QtCreatorLubuntuToWindows.pro

 


QT       += core QT       -= gui CONFIG   += console CONFIG   -= app_bundle TEMPLATE = app SOURCES += main.cpp LIBS += -L../../Libraries/mxe/usr/i686-pc-mingw32/lib LIBS += -lboost_regex

 

 

 

 

 

./CppHelloBoostRegexQt5QtCreatorLubuntuToWindows/main.cpp

 


#include <iostream> #include <boost/regex.hpp> int main() {   std::string s = "Hello World";   s = boost::regex_replace(s,boost::regex("World"),std::string("Boost"));   std::cout << s << '\n'; }

 

 

 

 

 

./CppHelloBoostRegexQt5QtCreatorLubuntuToWindows/CppHelloBoostRegexQt5QtCreatorLubuntuToWindows.sh

 


#!/bin/bash myfile="../../Libraries/mxe/usr/i686-pc-mingw32/qt5/bin/qmake" mytarget="CppHelloBoostRegexQt5QtCreatorLubuntuToWindows" myprofile=$mytarget.pro if [ ! -e $myprofile ] then   echo "FAIL: Qt Creator project '$myprofile' not found"   exit fi $myfile $myprofile if [ ! -e Makefile ] then   echo "FAIL: "$myfile" "$myprofile" (makefile not found)"   exit fi make if [ -e ./release/$myexe ] then   echo $mytarget": SUCCESS" else   echo $mytarget": FAIL (executable not found)" fi #Cleaning up rm -r release rm -r debug rm Makefile rm Makefile.*