how to set path to c++ headers in Ubuntu 14.04?

So I've done this in the past with 10.04 and 12.04, but I can't seem to figure this out in 14.04. I read on some old forum that it can't be done if using gnome desktop. I hate Unity, so here I am. There has to be a way. I've tried editing the .profile file by adding to the end of the file

1
2
export C_INCLUDE_PATH=$PATH:/home/jp/ogl-master/external/glew-1.13.0/include/GL
export C_INCLUDE_PATH=$PATH:/home/jp/ogl-master/external/glew-1.13.0/include/deps


I've tried other variations of this, as well, but no luck. I broke Ubuntu with one attempt and had to log in as root from a recovery bootup to fix it. It's fixed now, but I still can't seem to set the path. I'm pulling my hair out here. If anyone can help, I'd appreciate it.
Last edited on
Why a desktop would need such paths? The managed packages should install into well known locations, i.e. be found automatically.


Do you perhaps have a non-managed source install of some library that you want to link against when compiling one of your programs? How do you compile? With a build system? At least a Makefile?


The PATH is a list that a shell uses to locate binaries. Commands.
The compiler has an include-path for headers, but you can add more via its command-line options.
The linker probably needs a path option too to find the non-default libraries.
Neither path uses PATH.
Well, I got it to find one header by putting this in .bashrc

1
2
CPLUS_INCLUDE_PATH=/home/jp/ogl-master/external/glew-1.13.0/include/GL
export CPLUS_INCLUDE_PATH


But, if I add another, it won't find the first one.

To answer your questions, I'll use a makefile eventually, but for now, I'm trying a lot of different things with a lot of different little programs that I'd rather not have makefiles for each one, so I just use g++ -o..., and I don't want to have to type the directory each time.

I downloaded the source for openGL and made with cmake, but it didn't put the headers anywhere useful.

edit: libgles2-mesa-dev doesn't seem to have these headers. I got this source from www.opengl-tutorial.org
Last edited on
OK, so they answer my second question on this forum post:

https://ubuntuforums.org/archive/index.php/t-1717636.html

Your examples have glew, but you did look at gles2?
Last edited on
I had not heard of it until your post, but I'm more interested in high performance GPUs than embedded ones, if I understand correctly. Thanks anyway.
Topic archived. No new replies allowed.