NetBeans C++ setup on Linux - problems with debugging functionalities
I just installed Netbeans 6.5 (downloaded from Kubuntu repository)and set-up its plugins for C++.
I tested it with this simple code
//: C02:Scopy.cpp
// Copy one file to another, a line at a time
#include <string>
#include <fstream>
using namespace std;
int main() {
ifstream in("Scopy.cpp"); // Open for reading
ofstream out("Scopy2.cpp"); // Open for writing
string s;
while(getline(in, s)) // Discards newline char
out << s << "\n"; // ... must add it back
} ///:~
I compiled it (Run/Build), navigated to the directory where I found the executable, put a sample file "Scopy.cpp" in it, run the program with ./<name>, and it worked fine, it created Scopy2.cpp in the same directory and I was happy.
Then i tested the NetBeans Debug functions ("Step into" and "Step over", keys F7 and F8) and I stopped being happy.
I just can't get it to work, it does not seem to open the file for reading: I am sure of it because it does not enter the While block, and so I added the line
bool h=in.Is_Open();
and h remains "false".
Any idea? I thought that there must be some setup to indicate the path in which to look for files, and so I tried also to substitute
ifstream in("Scopy.cpp");
with
ifstream in("/home/.../Scopy.cpp");
but nothing changed.
Thanks
|