Search code examples
eclipseopencleclipse-cdt

OpenCL in Eclipse: Declaring global classes and structures


I'm trying to make a primitive Data management program which stores data in the form of a table and saves the table into a file for later use.

I haven't finished the program yet and needless to say, my program is not efficient. The thing is, I recently installed the OpenCL syntax highlighting extension for eclipse and now it is giving a global declaration error.

hu.ngms.opencl.editor.checkers.global_declaration_error 

and a warning

hu.ngms.opencl.editor.checkers.assignment_to_wrong_memory_space

I have tried searching for ways to avoid these errors using OpenCL address space: __global, but nothing happened (Probably used it in the wrong way)

then I tried using preprocessor directive

#ifdef __OPENCL_VERSION__

and due to all the frustration even tried decltype and typedef.

I even tried removing OpenCL from eclipse, but eclipse gives this error when I try to access the marketplace

Unexpected exception: loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name "org/apache/http/client/fluent/Executor"
loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name "org/apache/http/client/fluent/Executor"
loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name "org/apache/http/client/fluent/Executor"
loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name "org/apache/http/client/fluent/Executor"

ANY help in either removing OpenCL from eclipse or solving the errors or warnings is greatly appreciated.

PLEASE HELP

My Eclipse version is neon.1 (please let me know if any extra information is needed)

Code:

#include<iostream>
#include<string.h>
#include<fstream>
#include<conio.h>

using namespace std;

//#ifndef __OPENCL_VERSION__

union Cell;
struct table;
class Ctype;
class Cname;
class row;
//#endif

Note: I have removed the body of the code as I feel it is not nessary to show. If the detailed code is required, just ask :).

The main error is given at the end of the above code.

I basically have the following declared globally:

union Cell
struct table
class Ctype
class Cname
class row

Thanks in advance


Solution

  • I just went to the eclipse install folder and searched for the extension file, and manually moved them to a backup folder. Then made a new project with the same code and it now works :).

    Thank you all for taking your time :)