problems with fstream and iostream libraries I can't compile a cu file with host code if I incl

I can’t compile a *.cu file with host code if I include this libraries (fstream o iostream). I need to use it because in the principal file I call a class that read a file to get the information to send to the GPU. Does someone knew something about this?

What version of CUDA are you using? I’ve had these problems with CUDA 1.1 but in 2.0 I can include iostream and fstream without any problems (just checked).
If you still can’t get it to work with 2.0, you might want to have your host code in a separate .cpp file as in cppIntegration example.

I’m using Cuda 2.0 and now all works perfectly. I’ve remade the program with the same files and it works. Now my problem is with the CUDA library. I’ve include cutil.h and the compiler finds it but it said that the function cudaMalloc isn’t found.

add the libs’ path in the link property.

I had had it. The problem was that the examples of malloc doesn’t indicate that it’s used the library cuda_runtime_api.
Now it works perfectly.

Thank you

Can you explain how you made it work ?

Thanks.