Stib

Help with learning OpenCL, and C++

Discussion created by Stib on Oct 22, 2009
Latest reply on Nov 10, 2009 by omkaranathan
I'm a noob, help me please!

I have Windows 7 64-bit, Ms Visual Studio Professional Edition, an the latest Ati Stream SDK isntalled, on a Core2Duo E8400 system, with an EAH4850 graphic card. The samples are running, theres no problem with that.

 

I start VS, and click File->New->Project...

there Visual C++->Win32->Win32 Console Application, lets name it Test,

in the wizard i click empty project.

Now i right click on Test->Properties->Configuration Properties->

->C/C++->Genereal, and there, i add the include directory of Ati Stream, to the Additional Include Directories.

 

I can build, and run this sample code:

"#include

int main()
{
}

"

 

When i try

"#include

int main()
{
    cl_int a;
    cl_uint n_e=10;
    cl_platform_id *p=NULL;
    cl_uint *n_p=NULL;
    a=clGetPlatformIDs(n_e,p,n_p);
}
"

this code (may be buggy, sorry, im a noob), i get:

1>------ Build started: Project: Test, Configuration: Debug Win32 ------
1>Compiling...
1>Proba.cpp
1>Linking...
1>Proba.obj : error LNK2019: unresolved external symbol __imp__clGetPlatformIDs@12 referenced in function _main
1>C:\Users\Stib\Documents\Visual Studio 2008\Projects\Test\Debug\Test.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Stib\Documents\Visual Studio 2008\Projects\Test\Test\Debug\BuildLog.htm"
1>Test - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

What am i doing wrong? Can someone help me?

 

UPDATE: my 2 includes are the CL/cl.h

Outcomes