Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unable to resolve..." in NetBeans 6.7.1, Linux, C++

I am working with a small group on a C++ project in NetBeans.

For some reason, NetBeans is reporting things like "string", "endl", "cout" as "Unable to Resolve" even though the correct libraries have been included.

The project compiles and runs as expected, so at the end of the day, it is no big deal, it is just that having everything marked as an error makes it quite annoying.

I haven't been able to find anything on this bug. Just one vague reference in a blog. Has anyone else experienced it?

Obviously it isn't wide-spread, so there must be a setting/configuration that causes it. Does anyone know who to prevent this from happening?

EDIT:

No, these "errors" are solely in the IDE. The code compiles fine and runs. The developer has used "using namespace std;" so there should be no issues. It appears that the NetBeans IDE is buggy.

Sample code:

#include <stdlib.h>
#include <string>
#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
   string test;
   test = "Why?";

   cout << test << endl;

   return (EXIT_SUCCESS);
}

This code compiles and prints out "Why?" but has "string", "cout" and "endl" marked as errors in the IDE. Explicitly using std:: makes no difference

Clean up Edit:

For anyone interested, a few days later I had 6 updates available for NetBeans. After installing this updates, the problem was rectified, despite the code not changing. So, apparently it was a NetBeans bug.

like image 484
Dan McGrath Avatar asked Nov 15 '22 14:11

Dan McGrath


1 Answers

hmm.. this same thing just happened to me. One time I started NetBeans up it just underlined all my calls to openGL (gl, glu and glut), and I couldn't get rid of the errors. It compiled just fine (+ I did not change anything in the code since the last time it showed no errors)

After reading this post I checked for updates, updated and now it indicates no errors :) it's weird cuz I update regularly..

EDIT: nvm, now they are underlined again :(

like image 185
David Avatar answered Dec 19 '22 09:12

David