Issue with CUDA on Snow Leopard


I am having problems while running CUDA on Snow Leopard-GoldMaster version. I downloaded the latest CUDA driver which was for Snow Leopard OS. But I’m getting a few compilation errors. I am getting the same errors when i try to compile the sample CUDA programs provided with the SDK.

The errors are :

/usr/include/stdlib.h(272): error: expected an expression

/usr/include/stdlib.h(272): error: expression must have (pointer-to-) function type

/usr/include/stdlib.h(272): error: type name is not allowed

/usr/include/stdlib.h(274): error: expected a “)”

/usr/include/stdlib.h(301): error: expected a “)”

/usr/include/stdlib.h(307): error: expected a “)”

/usr/include/stdlib.h(313): error: expected a “)”

/usr/include/stdlib.h(319): error: expected a “)”

8 errors detected in the compilation of “/tmp/tmpxft_000015f0_00000000-4_MersenneTwister.cpp1.ii”.
make: *** [obj/release/] Error 255

I started getting these errors once I upgraded my Operating System from Leopard to Snow Leopard.
The amusing part is that, there isn’t any call to ‘stdlib.h’ at all in my program. So I was wondering if there could be some error with the driver.

Can you please help me figure this out?

Thank You,

You are not alone… :unsure:

You are not alone…


do you read other forum posts ?

Try this one:


Or, in other words, the old fix to change the links from gcc/g++ to 4.0 instead of 4.2 has to be done again. I had the same problem and that was all I had to do. But I think it is about time that the CUDA installer stops ruining fixes needed to make it work!

This problem as been solved a while ago. I have the last Cuda driver / toolkit (3.2) on Snow Leopard and i compile with gcc/g++ 4.2 without any issue.

Actually, it must have been an update of Apple’s Developer Tools that ruined my setup. So I take back any blame on NVIDIA in this issue.