AnsweredAssumed Answered

Error in 'cl.hpp'

Question asked by alexfd7 on Nov 3, 2015
Latest reply on Nov 4, 2015 by alexfd7

Hello everyone, thanks again for taking me here. I am new in this world of GPGPU, I'm still learning a lot, briefly, I am wanting to use GPUs with application purpose in medical image processing, for algorithms that require high computational resource, such as segmentation algorithms and co-registration.



As said, i had installed the sdk amd-app-sdk 3.0, and started coding examples in C, and all worked very well.

However when enters in C ++, I'm having some problems, i am a newbie, if anyone can help me, I will be grateful.



My problem is 'simple' when I compile any code in C ++ does not work, the cl.hpp class encounters an error.

Here is a code of an empty main program (full_context.cpp) when it generates a compile error, i tried to install other versions amd-app-sdk sdk, but not changed: 


The comand:

make g++ -Wall -DUNIX -g -DDEBUG  -m64 -o full_context full_context.cpp -I. -I/opt/AMDAPPSDK-2.9-1/include -L/opt/AMDAPPSDK-2.9-1/lib/x86_64 -lOpenCL



The result:

/opt/AMDAPPSDK-2.9-1/include/CL/cl.hpp:477:1: error: expected unqualified-id before ‘{’ token



full_context.cpp:20:1: error: expected ‘}’ at end of input



make: ** [full_context] Erro 1


The code:

#define __NO_STD_STRING
#include <iostream>
#ifdef MAC
#include <OpenCL/cl.hpp>
#include <CL/cl.hpp>

using namespace std;

int maind (void){

return 0;


--Some extra information

I working on UBUNTU mint


Platform Vendor:        Advanced Micro Devices, Inc.

Platform Version:       OpenCL 2.0 AMD-APP (1729.3)

Platform Name:         AMD Accelerated Parallel Proces

Device OpenCL C version: OpenCL C 2.0

Driver version:         1729.3 (VM)



I am newbie, maybe i forgetting to install something very simple for C++ codes, no C ++ code works, since the codes in C work very well.

if anyone can help me, I will be grateful.