Hello,
I am trying to get a simple c++ console application which compiles and run but the second I add a reference to boost it fails with segmentation fault.
main.cpp - this fails with segmentation fault (if i remove boost references it runs fine)
install g++ and boost
How to compile
Any ideas why this fails?
Thanks for any help you can get
I am trying to get a simple c++ console application which compiles and run but the second I add a reference to boost it fails with segmentation fault.
main.cpp - this fails with segmentation fault (if i remove boost references it runs fine)
C++:
#include <iostream>
#include <boost/thread.hpp>
using namespace std;
using namespace boost;
int main()
{
cout << "Hello World!";
return 0;
}
install g++ and boost
Code:
pkg install gcc
pkg install boost-all
How to compile
Code:
g++ -Wall -std=c++11 -fexceptions -O2 -c "main.cpp" -o "main.o"
g++ -o "main" main.o -s -lboost_system -lboost_thread
chmod +x ./main
./main
Segmentation fault (core dumped)
Any ideas why this fails?
Thanks for any help you can get
Last edited by a moderator: