What is the correct command to compile this code? http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio/example/http/client/async_client.cpp I had installed boost library in /usr/include/boost
Asked
Active
Viewed 563 times
1 Answers
2
E.g.
clang++ -std=c++03 -Wall -pedantic -g -O2 async_client.cpp -o async_client -lboost_system -lboost_thread -lpthread
Assuming your system's packaged version of Boost (or pre-configured include & lib paths). To make use of your custom built Boost library tree in ~/custom/boost
:
clang++ -std=c++03 -Wall -pedantic -g -O2 \
-isystem ~/custom/boost/ ~/custom/boost/libs/asio/example/cpp03/http/client/ \
async_client.cpp -o async_client \
-L ~/custom/boost/stage/lib/ -Wl,-rpath,/home/sehe/custom/boost/stage/lib \
-lboost_system -lboost_thread -lpthread
Replace clang++
by g++
at will.
-std=c++03 -Wall -pedantic -g -O2
only for expositional purposes.

sehe
- 374,641
- 47
- 450
- 633