Reputation: 3961
I need to compiler source code that contains includes like this:
#include <tr1/unordered_map>
However my compiler (based on GCC 4.6) does not have the tr1
directory. I need to somehow tell the compiler to map <tr1/unordered_map>
to <unordered_map
without modifying source code of file system?
Upvotes: 1
Views: 437
Reputation: 119847
Gcc headers <unordered_map>
and <tr1/unordered_map>
are different. One requires C++11 support turned on, the other does not. Substituting one for the other may or may not work.
Probably the easiest solution to your problem is to use the tr1
implementation from Boost.
Upvotes: 1
Reputation: 53310
A bit hacky: Go to the include directory containing unordered_map
and:
ln -s . tr1
Upvotes: 0
Reputation: 1636
when you build your code, provide include directory as an argument.
-I. - For current directory as an include directory
-I tr1 - tr1 as an include directory.
-I /yourpath/ - To put any directory as include directory
Upvotes: 1