(C++) 'Hello Boost' using Qt Creator under Ubuntu

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) BoostUbuntu 'Hello Boost' using Qt Creator under Ubuntu

 

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.

 

 

 

 

 

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: CppHelloBoostQtCreatorUbuntu.pro

 


QT       += core QT       -= gui CONFIG   += console CONFIG   -= app_bundle TEMPLATE = app SOURCES += main.cpp LIBS += \   -lboost_date_time \   -lboost_filesystem \   -lboost_program_options \   -lboost_regex \   -lboost_signals \   -lboost_system

 

 

 

 

 

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'; }

 

 

 

 

 

Makefile