Trying to compile a boost C++ code I have found out that one needs to name the libraries to be used explicit. So, given the following code:
#include<iostream>
#include<boost/filesystem/operations.hpp>
namespace bfs=boost::filesystem;
int main()
{
bfs::path p("second.cpp");
if(bfs::exists(p))
std::cout<<p.leaf()<<std::endl;
}
I am able to compile (and link) it with the following command line
g++ -o main main.cpp -lboost_filesystem -lboost_system
How can I define those -l
libraries in eclipse, so that eclipse is able to compile (and link) the code without an undefined reference
error?
This is a question on the usage and configuration of eclipse.