Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse 3.1 CDT 3.0 variables and macros
Eclipse 3.1 CDT 3.0 variables and macros [message #156421] Sun, 16 October 2005 20:16
Eclipse UserFriend
Originally posted by: califax.uni.de

Hello,

currently I am trying to move my project from VC++ 7.1 to Eclipse (on
Windows) using g++ 3.4 (from the cygwin distribution). To arrange all
that I try to setup a managed C++ make project.

Unfortunately this turns out to be more complex than i have expected.
First here is what I found out during some long term try and error.

There exists the possibility to specify environment variables in
eclips. To access these I use the syntax $(variable). Furthermore there
are so called macros. To access the value of a macro I use the syntax
${macro}. Since my project in VC++ 7.1 uses a pre-compiled header which
is something I want to keep this way I created a custom builder which
is to invoke gcc for compiling the header in question. So far so good.

Now my problems.

1. When setting an environment variable in the project properties which
specifies the include directory of say one certain library I can use
either the cygwin way to specify this path (e.g.
/cydrive/c/__LIBs/myLib) or the Windows way (C:\__LIBs\myLib). I use
this environment variable then to specify an include directory (using
the $()-syntax) In the case of using the Cygwin Syntax for the path
eclipse reports a problem that the include path
c:\<restOfProjectDir\$(incvar) does not exist. This is not nice - but
the compiler understands the path that it receives. On the other hand:
If I use the Windows Way to specify the include path eclipse doesn't
say a word about it (probably because it understands the Windows Path)
but then the compiler is not working any more since it is not able to
deal with the window path that results fron the variable substitution.

2. To achieve that a pre-compiled header is produced I created a new
builder. This builder is to invoke g++ on the header file. When
searching in the dialog for configuring the builder I found environment
variables again and in addition there were buttons that invoked a
"Variables" dialog. I tried to get the include path for myLib (see
above) from the environment variable (whose content is specified in
Cygwin path syntax) using "-I$(incvar)" in the addition arguments input
field on the "Main" tab of the builder config dialog - didn't work. It
seems that the compiler didn't receive the value of the variable. I
specified the environment variable for the builder environment itself -
didn't work.

Only specifying the include path as value of a "variable" (not
environment variable) led to a kind of success. To access the value of
the "variable" I use the same syntax as for accessing a macro. With
this I have the problem that I can specify the variable only in the
builder dialog but it was also in the main project settings accessible
but not visible anywhere (at least I haven't found it). Where can I
define such a variable when I just want to use a "default builder"? Is
there a solution to the cygwin path problem? How do Macros and
Variables relate??

Thsnks in advance

Lars
Previous Topic:error parser for watcom
Next Topic:Linker problem: undefined reference, trying to use a function defined in a .dll
Goto Forum:
  


Current Time: Thu Jul 25 13:45:38 GMT 2024

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

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

Back to the top