Below is my list of includes. When I run the program I get this error..
fatal error: boost/random/uniform_int_distribution.hpp: No such file or directory
Well…problem is the file is there and when I comment out the include the other files are found and the program compiles. I really don’t understands how this happens. Any explanation?
My boost home is /home/ubuntu/boost/ so the path is /home/ubuntu/boost/boost/random/uniform_int_distribution.hpp
Here is how I invoke:
g++ rtb.cpp -o rtb.o -L/home/ubuntu/boost -L/usr/local/include/ -lfcgi++
Here are te includes
#include <boost/tokenizer.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <boost/bimap.hpp>
#include <boost/multi_array.hpp>
#include <cassert>
#include <boost/config.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/visitors.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <map>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/member.hpp>
The problem is that you are using -L (which gives the directories where the libraries of object files can be found) when you should use -I giving the directory where the compiler will look for include files
gcc’s documentation for library search also from gcc /usr/local/include is always included.
Thus from @nttstar’s answer that the uniform_int_distribution.hpp header was added in boost 1.47 an before that there’s only uniform_int.hpp.
I think the reason why you see the error just for this one header is that you are finding an older boost in /usr/local/include