Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse IDE not recognizing include header. I get red squigglies under class names(Trying to create Eclipse project from exiting Intel OpenCL sample make files)
Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776376] Wed, 15 November 2017 19:51 Go to next message
Rick Blacker is currently offline Rick BlackerFriend
Messages: 14
Registered: August 2016
Junior Member
Hi all... I'm having a hard time trying to create an Eclipse project based on make files from the Intel OpenCL samples download. I admit, a lot of my problem will most likely be contributed to not having a strong C++/Eclipse foundation of knowledge.

Intel OpenCL downloads page
https://software.intel.com/en-us/intel-opencl-support/code-samples

In specific, the Linux download bundle
https://software.intel.com/sites/default/files/managed/41/64/intel_ocl_samples.zip

If I download and extract them, at the root I can run make. All the samples seem to build properly.

I wanted to create an Eclipse project out of one of them, "GodRays" to be specific. I created a new project via File -> New -> Makefile project with existing code. This compiles properly and I get my executable, however the Eclipse IDE gives me all kinds of squiggly line errors under all the intel specific classes and functions inside the source code as well as the OpenCL functions and classes.

I've ensured that I have my include directories setup properly, yet, I get the red squiggly lines.

Was hoping that someone might be able to point me in the proper direction to get Eclipse setup properly so that these names can be resolved properly in the IDE.

Thanks!
Re: Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776441 is a reply to message #1776376] Thu, 16 November 2017 13:21 Go to previous messageGo to next message
David Vavra is currently offline David VavraFriend
Messages: 626
Registered: October 2012
Senior Member
You need to inform the CDT indexer where to to find the includes.
This is in addition to telling the compiler when building a make file.

https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_general_sd_entries.htm
There is some discussion on discovery here: https://www.eclipse.org/community/eclipse_newsletter/2013/october/article4.php

When all else fails you can always add them to the CDT User Settings Entries on the Entries tab.

Re: Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776482 is a reply to message #1776441] Thu, 16 November 2017 20:49 Go to previous messageGo to next message
Rick Blacker is currently offline Rick BlackerFriend
Messages: 14
Registered: August 2016
Junior Member
David Vavra wrote on Thu, 16 November 2017 13:21
You need to inform the CDT indexer where to to find the includes.
This is in addition to telling the compiler when building a make file.

https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_general_sd_entries.htm
There is some discussion on discovery here: https://www.eclipse.org/community/eclipse_newsletter/2013/october/article4.php

When all else fails you can always add them to the CDT User Settings Entries on the Entries tab.


Hi Dave,

To the best of my knowledge I have done what's needed per the links you sent me, but I'm still getting Symbol errors. Again, things compile just fine.
Here is the IDE showing the bad symbol references
index.php/fa/31285/0/

Here is what I have setup for CDC. I've added the path to the OpenCL header files which contain the definitions/code for the OpenCL classes and functionality.
index.php/fa/31286/0/

[Updated on: Thu, 16 November 2017 20:50]

Report message to a moderator

Re: Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776487 is a reply to message #1776482] Fri, 17 November 2017 00:32 Go to previous messageGo to next message
David Vavra is currently offline David VavraFriend
Messages: 626
Registered: October 2012
Senior Member
Have you tried rebuilding the index after adding the path?

It looks like what is missing are the definitions for CL_PLATFORM_NAME etc.

[Updated on: Fri, 17 November 2017 00:45]

Report message to a moderator

Re: Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776557 is a reply to message #1776487] Fri, 17 November 2017 16:28 Go to previous messageGo to next message
Rick Blacker is currently offline Rick BlackerFriend
Messages: 14
Registered: August 2016
Junior Member
I clicked Apply and Close. Based on what you just mentioned, I'm assuming that building the index is completely different. I didn't see anything about rebuilding the index. But I'll go look for it.
Re: Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776588 is a reply to message #1776557] Sat, 18 November 2017 04:18 Go to previous messageGo to next message
David Vavra is currently offline David VavraFriend
Messages: 626
Registered: October 2012
Senior Member
Project --> C/C++ Index --> Rebuild
You can also search for unresolved includes.
It seems that the file defining CL_PLATFORM_NAME etc. was not scanned.

Re: Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776638 is a reply to message #1776588] Sun, 19 November 2017 18:56 Go to previous messageGo to next message
Rick Blacker is currently offline Rick BlackerFriend
Messages: 14
Registered: August 2016
Junior Member
That didn't seem to help.
I'm getting both index and compile errors. For some reason Eclipse is not resolving the header files that are in
/home/rick/IntelOpenCLSamples/common

As an example these lines of code come from a header file in /home/rick/IntelOpenCLSamples/common/basic.hpp/cpp
std::string tmp = wstringToString(L"GodRays.rgb");
SAMPLE_CHECK_ERRORS(err);


I just randomly picked those two lines of code out of the sample file. Anyway, those are throwing errors both visually in the IDE and at compile time.

I've included the path in the includes area. I've even hard coded the path in the #include statement in the source code.

I'm really scratching my head here.
index.php/fa/31320/0/
Re: Eclipse IDE not recognizing include header. I get red squigglies under class names [message #1776639 is a reply to message #1776638] Sun, 19 November 2017 19:11 Go to previous message
Rick Blacker is currently offline Rick BlackerFriend
Messages: 14
Registered: August 2016
Junior Member
Could it be because these source code samples where written to accommodate both Windows and Linux? There are several preprocessor directives that allow for both OS support. But even then, when I run the make file, there are no problems.
Previous Topic:Importing Paths and Symbols from command line?
Next Topic:Can't find linked file
Goto Forum:
  


Current Time: Mon Dec 11 22:59:42 GMT 2017

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

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