ifstream problem

Hello,

I want to use “ifstream” in a .cpp file to read data.
When i run with Emudebug that works, but when i use Release that doesn’t work.
Is it normal ? What should i do ?

Thanks for your reply

It’s strange : that works now !

It 's OK now. B)

I have a problem about “ofstream” to write data in a file.
The associated code is in a .cpp file. I use extern c to link it to cuda code.

Actually, i can write in a file by pressing “F5”.

But when i use the .exe file that doesn’t work.

How can i do ?

This forum isn’t really the right place to ask about basic C++ things. It’s about CUDA programming and development.

Hi Andrei,

I’ve a problem.

I have a program with a routine like this. It is in the main part not in the .cu file.

int Model::ReadBasic_list(void) {

ifstream in;

in.open("simnum.txt");

in>>nloop;

in.close();

}

The file simnum.txt contain only a line with the character “1”

I compile the program with

make dbg=1

If I use gdb to debug the code, nloop will be one after the routine.

If I run cuda-gdb it will be 0 and the code will not run correctly so I cannot debug the part of the code that use the GPU.

Can you explain me why this happen?

Bye

Gaetano

I found that the same program compiled and debugged on two freshly installed system (Fedora and Ubuntu) does not exhibit the same problem. It is probably due to the Fedora 13 system I have upgraded a couple of time since Fedora 9. I’ll try to freshly install Fedora 14.