(C++) 'Hello Boost' using Qt Creator under Windows
February 24, 2017 · View on GitHub
(C++) 

'Hello Boost' using Qt Creator under Windows
Hello Boost is an extension of Hello World. Like Hello World, Hello Boost is a simple console application. Hello Boost, however, also requires the Boost library and to link against the Boost.Regex library.
- Download the Qt Creator project 'HelloBoost' (includes makefile)(zip): this download works under both Ubuntu and Windows (if the path to the Boost.Regex library is valid on the Windows computer)
Operating system: Windows XP
IDE: Qt Creator 2.0.0
Project type: console application
Libraries used:
- Boost: version 1.40
- STL: from GCC, shipped with Qt Creator 2.0.0
Qt project file
#------------------------------------------------- # # Project created by QtCreator 2010-09-29T14:48:25 # #------------------------------------------------- QT += core QT -= gui TARGET = CppHelloBoost unix:LIBS += -L/usr/lib -lboost_regex win32:LIBS +=C:/Qt/2010.02.1/qt/lib/libboost_regex.lib CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp
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'; }