Hi,
I am trying to compile the code from the tutorial "Introductory Tutorial to OpenCL" and I am getting a "alloca: identifier not found" error message from cl.hpp. Don't you have to include malloc.h if you want to use alloca? Adding the include fixes the error.
Thank you,
Rodrigo
Which OS are you using?
The problem is I expect down to the fact that "alloca.h" is for some reason not being included in cl.hpp. You should be able to add it before including cl.hpp.
I am using Windows Vista.
Which version of Visual Studio?
Could you try putting the following lines before including cl.hpp:
#include <malloc.h>
#define alloca _alloca
I have Visual Studio 2008.
Most probably adding those two lines would work but why pass the burden to the programmer Wouldn't it be better to modify cl.hpp?
Originally posted by: brg Which OS are you using?
The problem is I expect down to the fact that "alloca.h" is for some reason not being included in cl.hpp. You should be able to add it before including cl.hpp.
Yes, "alloca.h" isn't included because of the preceeding line:
"#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)"
It seems that the inclusion isn't wanted for WIN32-systems and I think the header also isn't available there.
But adding the two lines helps so far. Is there anyone else who encounters the described problem on Windows systems?