This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have 6 header files, 2 of them end up being greyed out between #ifndef and #endif. Anything outside of that looks normal. Code functions properly. Only able to resolve by removing #include statements throughout the program and then re-enter them. Closing and opening doesn't fix the issue, nor does the restarting of the computer. Sample header file in question: #include "Color.h" #include <string> using namespace std; #ifndef _IMAGELOADER_H_ #define _IMAGELOADER_H_ class ImageLoader { public: virtual Color** loadimage(string filename)=0; virtual void saveimage(string filename, Color** img, int w, int h)=0; int width; int height; string datatype; unsigned int maxval; }; #endif
It would be great if you can try daily bits just to check if already fixed in trunk. http://bits.netbeans.org/dev/nightly/latest/ If reproducible in nightly, could you, please, try to create sample project and attach it here, so I will be able to debug it. Thanks! Vladimir.
btw, your example of header file is not usual. In most cases all code is put between #ifndef _IMAGELOADER_H_ #define _IMAGELOADER_H_ ... #endif while you have some code above #ifndef _IMAGELOADER_H_ You can try and move #ifndef _IMAGELOADER_H_ #define _IMAGELOADER_H_ to be above all statements (and below copyright text if you have it)
Specifically, I propose to change code to be: ----------- /** * Copyright */ #ifndef _IMAGELOADER_H_ #define _IMAGELOADER_H_ #include "Color.h" #include <string> using namespace std; class ImageLoader { public: virtual Color** loadimage(string filename)=0; virtual void saveimage(string filename, Color** img, int w, int h)=0; int width; int height; string datatype; unsigned int maxval; }; #endif --------
(In reply to comment #3) Hmm, I've been writing code (and was taught to write the code) with #include outside of #ifndef #endif... > Specifically, I propose to change code to be: > ----------- > /** > * Copyright > */ > #ifndef _IMAGELOADER_H_ > #define _IMAGELOADER_H_ > > #include "Color.h" > #include <string> > > using namespace std; > > class ImageLoader > { > public: > virtual Color** loadimage(string filename)=0; > virtual void saveimage(string filename, Color** img, int w, int h)=0; > > int width; > int height; > string datatype; > unsigned int maxval; > }; > > > #endif > --------
(In reply to comment #4) > It would be great if you can try daily bits just to check if already fixed in > trunk. > http://bits.netbeans.org/dev/nightly/latest/ > > If reproducible in nightly, could you, please, try to create sample project and > attach it here, so I will be able to debug it. > > Thanks! > Vladimir. So moving back to incomplete, as there is no sign of check and no project attached.
(In reply to comment #3) By the way, what does that Copyright multi-line comment do? Is it just to let the others know that it's an intellectual property? > Specifically, I propose to change code to be: > ----------- > /** > * Copyright > */ > #ifndef _IMAGELOADER_H_ > #define _IMAGELOADER_H_ > > #include "Color.h" > #include <string> > > using namespace std; > > class ImageLoader > { > public: > virtual Color** loadimage(string filename)=0; > virtual void saveimage(string filename, Color** img, int w, int h)=0; > > int width; > int height; > string datatype; > unsigned int maxval; > }; > > > #endif > --------
It appears Vladimir's suggestion of having #include statements inside of header definition fixed the issue. I don't see a re-occurrence under the same conditions. Thank you, Vladimir.
A follow up: I've been working on the project all day long and the issue did not re-occur. Vladimir's solution solved it 100%. Thank you, sir!