5 Replies Latest reply on Mar 26, 2010 5:54 AM by christy01

    AMD OpenCL "Hello World" program does not compile with MSVC++ 2008.

    Ivoshiee
      I am trying to get into OpenCL programming, but even the introductory program does not compile.

      http://developer.amd.com/gpu/ATIStreamSDK/pages/TutorialOpenCL.aspx

      Has a basic "Hello World" implemented in OpenCL, but I fail to compile it.

      To set aside that it has a missing "}" in checkErr then more serious issue does come within ATI Stream SDK v2.01 provided cl.hpp file:

      C:\lesson1>cl /Fehello_world.exe /I"C:\Program Files\ATI Stream\include" lesson1
      .cpp "C:\Program Files\ATI Stream\lib\x86\OpenCL.lib"
      Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
      Copyright (C) Microsoft Corporation.  All rights reserved.

      lesson1.cpp
      C:\Program Files\ATI Stream\include\CL/cl.hpp(1388) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\ATI Stream\include\CL/cl.hpp(1407) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\ATI Stream\include\CL/cl.hpp(1658) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\ATI Stream\include\CL/cl.hpp(3379) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\ATI Stream\include\CL/cl.hpp(3380) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\ATI Stream\include\CL/cl.hpp(3459) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\ATI Stream\include\CL/cl.hpp(3460) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\ATI Stream\include\CL/cl.hpp(3708) : error C3861: 'alloca': ide
      ntifier not found
      C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C
      4530: C++ exception handler used, but unwind semantics are not enabled. Specify
      /EHsc
      lesson1.cpp(30) : error C2039: 'vector' : is not a member of 'std'
      lesson1.cpp(30) : error C2065: 'vector' : undeclared identifier
      lesson1.cpp(30) : error C2275: 'cl:latform' : illegal use of this type as an e
      xpression
      lesson1.cpp(30) : error C2065: 'platformList' : undeclared identifier
      lesson1.cpp(31) : error C2065: 'platformList' : undeclared identifier
      lesson1.cpp(32) : error C2065: 'platformList' : undeclared identifier
      lesson1.cpp(32) : error C2228: left of '.size' must have class/struct/union
              type is ''unknown-type''
      lesson1.cpp(33) : error C2065: 'platformList' : undeclared identifier
      lesson1.cpp(33) : error C2228: left of '.size' must have class/struct/union
              type is ''unknown-type''
      lesson1.cpp(36) : error C2065: 'platformList' : undeclared identifier
      lesson1.cpp(36) : error C2228: left of '.getInfo' must have class/struct/union
      lesson1.cpp(39) : error C2065: 'platformList' : undeclared identifier

      C:\lesson1>

      Btw: The Khronos OpenCL API Registry provided files did produce even more errors.

      Is it just me or that example is not working for anybody?

      What am I doing wrong and/or can that OpenCL example be fixed?