Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CPLUS_INCLUDE_PATH doesn't works

Tags:

include

gcc

I have set my environment variable CPLUS_INCLUDE_PATH to boost.

>echo $CPLUS_INCLUDE_PATH
boost

But it doesn't work at all.

>g++ parse_utils.cpp
parse_utils.cpp:1:34: fatal error: boost/lexical_cast.hpp: No such file or directory

The .hpp is in that path.

>g++ parse_utils.cpp -Iboost 
(work well)

I thought CPLUS_INCLUDE_PATH is equivalent to -I option?

>g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
like image 714
Lai Yu-Hsuan Avatar asked Jun 18 '12 13:06

Lai Yu-Hsuan


1 Answers

You need to export the variable before running g++:

export CPLUS_INCLUDE_PATH
like image 140
rasmus Avatar answered Nov 15 '22 01:11

rasmus