Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Resolving preprocessor directive errors
Resolving preprocessor directive errors [message #1786126] Wed, 25 April 2018 21:01 Go to next message
Russell West is currently offline Russell WestFriend
Messages: 5
Registered: January 2016
Junior Member
I have started working on a new program that has a C++ project and Java project that interface via CORBA (don't laugh it was written 20+ years ago). In the C++ classes there are lines such as #Include INC_FILE(IESAdminIf) where IESAdminIf refers to the file IESAdmin.idl located in a different level of the C++ project directory structure. I am getting Invalid Preprocessor Directive errors for each line with this type of syntax. Based on internet research I have tried to add a Preprocessor Symbol to be incorporated in the C++ compile -D option through the Eclipse IDE that will define what INC_FILE(IESAdminIf) references with no success. I have tried several different versions of the defined preprocessor symbol syntax but none work. At this time I am not 100% sure if compiler preprocessor symbols is the correct way to resolve the reported Invalid Preprocessor Directive errors or if so the correct way to generate such through the Eclipse IDE. Any assistance is desired and greatly appreciated.
Re: Resolving preprocessor directive errors [message #1786133 is a reply to message #1786126] Wed, 25 April 2018 23:08 Go to previous message
David VavraFriend
Messages: 777
Registered: October 2012
Senior Member
Presumably, #Include INC_FILE(IESAdminIf)
doesn't follow the syntax for #include directives
assuming that INC_FILE(IESAdminIf) is a macro.
https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html#index-_0023include

This really doesn't have anything to do with Eclipse.
The preprocessor is a phase of the compiler.
Eclipse does do some preprocessor handling for syntax analysis though.
Are you saying that Eclipse and the compiler differ in their processing?

The thing to do is try to find out what the preprocessor is seeing.
GCC has #pragma message string
https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html

You can also output the results of preprocessing by using the -E option
https://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Overall-Options.html#Overall-Options
What it produces: https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html

But if there is a problem with preprocessor syntax this may not work well.

Visual C has similar capabilities.


[Updated on: Wed, 25 April 2018 23:31]

Report message to a moderator

Previous Topic:My plugin can't add to menu when right-clicking the editor
Next Topic:Eye detection using Haarcascades in c++
Goto Forum:
  


Current Time: Sat Sep 22 12:03:15 GMT 2018

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

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

Back to the top