Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Environment Variable can't be used
Environment Variable can't be used [message #215420] Sun, 04 May 2008 10:12 Go to next message
Eclipse UserFriend
Hello,

I've got a System Environment Variable which is called "include", and it
contains the path to all my include directories.

Now, I want to use this variable inside my project, so that other
developers can just use their own "include"-variable as well, but I can't
use it.

I went to Project Properties, C/C++ Build, Settings, GCC C++ Compiler,
Directories, and there I wanted to add "%include%", I also tried "include"
and "${include}" as well, but none of those were successful.

What am I doing wrong? Or isn't it possible at all?
Re: Environment Variable can't be used [message #215471 is a reply to message #215420] Mon, 05 May 2008 06:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: newsgroups.snipah.com

Hi Christian,

If your variable contains only one path it works well for me (CDT 4.0.1
and 5.0.0)

Simply add the variable to the path&symbols page e.g. ${include} and it
will also appear in the compiler settings and includes-folder.

You have to add each include path and not a list of all paths.

e.g. include=/usr/include:/usr/lib/include

this will expand to the gcc argument -I/usr/include:/usr/lib/include

Enrico


Christian Gleinser wrote:
> Hello,
>
> I've got a System Environment Variable which is called "include", and it
> contains the path to all my include directories.
>
> Now, I want to use this variable inside my project, so that other
> developers can just use their own "include"-variable as well, but I
> can't use it.
>
> I went to Project Properties, C/C++ Build, Settings, GCC C++ Compiler,
> Directories, and there I wanted to add "%include%", I also tried
> "include" and "${include}" as well, but none of those were successful.
>
> What am I doing wrong? Or isn't it possible at all?
>
Re: Environment Variable can't be used [message #216140 is a reply to message #215471] Fri, 16 May 2008 05:14 Go to previous message
Eclipse UserFriend
Hello,

thanks for your answer! Well, I haven't got a "path&symbols" page (at
least I can't find it), I have got "C/C++ Build" - "Environment", and
there are three variables defined (PWD, CWD, PATH). I can also click
"Select..." and then add my system variable "include", but I can't then
use it inside "C/C++ Build" - "Settings" - "Tool Settings" - "GCC C++
Compiler" - "Directories".

I'd like to just use this "INCLUDE" variable there, but I have to specify
the paths directly. For a single developer this might not be a problem,
but since I'm doing this project with someone else, it would be cool if he
could just use his own INCLUDE variable as well, with a different content.
Previous Topic:Can I generate makefile from CDT managed build with relative paths?
Next Topic:Remote Indexing
Goto Forum:
  


Current Time: Thu Jun 19 06:38:53 EDT 2025

Powered by FUDForum. Page generated in 0.28054 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top