Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) HelloBoostLexical_CastQt5QtCreatorLubuntuToWindows

 

BoostQt5Qt CreatorLubuntuToWindows

 

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

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppHelloBoostLexical_CastQt5QtCreatorLubuntuToWindows/CppHelloBoostLexical_CastQt5QtCreatorLubuntuToWindows.pro

 

include(../../ConsoleApplication.pri) #Or use the code below
# QT += core
# QT += gui
# greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
# CONFIG   += console
# CONFIG   -= app_bundle
# TEMPLATE = app
# CONFIG(release, debug|release) {
#   DEFINES += NDEBUG NTRACE_BILDERBIKKEL
# }
# QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra -Weffc++
# unix {
#   QMAKE_CXXFLAGS += -Werror
# }

include(../../Libraries/Boost.pri) #Or use the code below
# win32 {
#   INCLUDEPATH += \
#     ../../Libraries/boost_1_54_0
# }

SOURCES += main.cpp

 

 

 

 

 

./CppHelloBoostLexical_CastQt5QtCreatorLubuntuToWindows/main.cpp

 

#include <iostream>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <boost/lexical_cast.hpp>
#pragma GCC diagnostic pop

int main()
{
  const int x = 110;
  const int y = 0;
  const int z = 1;
  const std::string s
    = std::string("He")
    + boost::lexical_cast<std::string>(x)
    + std::string(" w")
    + boost::lexical_cast<std::string>(y)
    + std::string("r")
    + boost::lexical_cast<std::string>(z)
    + std::string("d");
  std::cout << s << '\n';
}

/* Screen output:

He110 w0r1d

*/

 

 

 

 

 

./CppHelloBoostLexical_CastQt5QtCreatorLubuntuToWindows/CppHelloBoostLexical_CastQt5QtCreatorLubuntuToWindows.sh

 

#!/bin/bash
myfile="../../Libraries/mxe/usr/i686-pc-mingw32/qt5/bin/qmake"
mytarget="CppHelloBoostLexical_CastQt5QtCreatorLubuntuToWindows"
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.*

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml