| View previous topic :: View next topic |
| Author |
Message |
SystemOverload
Joined: 17 Mar 2009 Posts: 6 Location: United Kingdom
|
Posted: Wed Mar 18, 2009 9:05 pm Post subject: cannot find include file <iostream> // But it still works?!?! |
|
|
After finally getting Netbeans and Cygwin installed and reinstalling (several times) the various missing sections I was able to run the HELLO WORLD 'programme'.
It appears to works fine, despite there being a little red exclamation mark over the line number next to the entry
| Code: | | #include <iostream> |
which says | Code: | | cannot find include file <iostream> |
Should I be worried that it says it can't find the file and how come it works despite not being able to find the file?!?
Thanks
SO
---------------------------------------------------
All Code is as follows:
| Code: | // my first program in C++
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
|
|
|
| Back to top |
|
 |
Vladimir Voskresensky Posted via mailing list.
|
Posted: Thu Mar 19, 2009 12:06 pm Post subject: cannot find include file <iostream> // But it still works?!?! |
|
|
Please, press Ctrl+hover mouse over #include <iostream>
you should see the analyzed paths info. If it is empty => something is
not configured.
Probably you will need start with clean user dir or in
Tools->Options->C++->Build Tools press "Restore Defaults" button to
reread system paths for code assistance
Thanks,
Vladimir.
SystemOverload wrote:
| Quote: | After finally getting Netbeans and Cygwin installed and reinstalling (several times) the various missing sections I was able to run the HELLO WORLD 'programme'.
It appears to works fine, despite there being a little red exclamation mark over the line number next to the entry
Code:
#include <iostream>
which says
Code:
cannot find include file <iostream>
Should I be worried that it says it can't find the file and how come it works despite not being able to find the file?!?
Thanks
SO
---------------------------------------------------
All Code is as follows:
Code:
// my first program in C++
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
|
|
|
| Back to top |
|
 |
SystemOverload
Joined: 17 Mar 2009 Posts: 6 Location: United Kingdom
|
Posted: Thu Mar 19, 2009 1:00 pm Post subject: |
|
|
I DEFAULTed the paths, which remained the same, I didn't think that would change it as NB will DEBUG and BUILD "Hello World" without any problems.
When ctrl-hovering over #INCLUDE i get an "unresolved directive" error.
I'm guessing it isn't really a problem unless IDE refuses to build/debug. I commented out <b><i>#include <iostream></i></b> and sure enough it throws a fit, so it DOES know where iostream is, it just doesn't think it does. LOL
Kinda strange. but it works for now. Anyone else experienced this, please let me know
|
|
| Back to top |
|
 |
Vladimir Voskresensky Posted via mailing list.
|
Posted: Thu Mar 19, 2009 5:58 pm Post subject: cannot find include file <iostream> // But it still works?!?! |
|
|
1) Do you use NB 6.5? In 6.7 you will see info about the analyzed
folders when include directive is unresolved.
2) Sometimes it helps to modify file and save it for the problem to gone
3) Sometimes it helps to close file/open file
4) Sometimes it happens when file remained opened after closing IDE and
opened as the first file during opening IDE
So, yes, I've faced the same issues as well :-)
Hope it helps,
Vladimir.
SystemOverload wrote:
| Quote: | I DEFAULTed the paths, which remained the same, I didn't think that would change it as NB will DEBUG and BUILD "Hello World" without any problems.
When ctrl-hovering over #INCLUDE i get an "unresolved directive" error.
I'm guessing it isn't really a problem unless IDE refuses to build/debug. I commented out <b><i>#include <iostream></i></b> and sure enough it throws a fit, so it DOES know where iostream is, it just doesn't think it does. LOL
Kinda strange. but it works for now. Anyone else experienced this, please let me know :)
|
|
|
| Back to top |
|
 |
jtengland
Joined: 21 Aug 2009 Posts: 2
|
Posted: Fri Aug 21, 2009 12:15 am Post subject: Same basic issue and tearing my hair out |
|
|
I have just installed NetBeans 6.7 C/C++ and Cygwin 1.5.25-15 on a WinXP 64 machine.
With all new projects, including the welcome project, I get the same "Cannot find include file <iostream>," or any other include file.
I have set the environment variables as instructed, and I have also set the proper include directory by right-clicking the Header Files folder in my project > Properties > C++ Compiler > Include directories
and setting it as "C:/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++"
A basic search shows that the iostream include file is in fact in that folder, but I still get the same red exclamation point. I have tried the above listed steps with the same results. If I've defined the correct include directory within my project, I'm not sure what the next step could possibly be.
Any help for the stressed?
edit: and I even defined the include folder in the source code properties with no luck.
|
|
| Back to top |
|
 |
Alexey Vladykin Posted via mailing list.
|
Posted: Wed Aug 26, 2009 9:18 pm Post subject: cannot find include file <iostream> // But it still works?!?! |
|
|
Standard headers like iostream are configured at tool collection level, not
at project level.
Please open Tools -> Options -> C/C++ -> Build tools and make sure that
Cygwin tool collection is listed. If not - create it. Then in project
properties -> Build make sure that Cygwin tool collection is selected.
Alexey
|
|
| Back to top |
|
 |
jtengland
Joined: 21 Aug 2009 Posts: 2
|
Posted: Thu Aug 27, 2009 8:02 am Post subject: Awesome |
|
|
| Quote: | Then in project
properties -> Build make sure that Cygwin tool collection is selected.
|
Perfect, I already had Cygwin defined at the tool collection level, but it was that last bit that I needed to do. Thanks very much for the help, Alexey!
|
|
| Back to top |
|
 |
monkeytroy
Joined: 17 Sep 2009 Posts: 1
|
Posted: Thu Sep 17, 2009 6:52 pm Post subject: same prob with mac |
|
|
I am having the same problem with NetBeans 6.7.1 on Mac OSX 10.5.8.
My helloworld app will build and run fine, but the includes are highlighted in red and report "cannot find include file <iostream>" or <cstdlib> or whatever else should be found.
As described above, I can then do a build and run and everything works... NB just reports, in the editor, that they cannot be found.
|
|
| Back to top |
|
 |
Vladimir Voskresensky Posted via mailing list.
|
Posted: Fri Sep 18, 2009 8:56 am Post subject: cannot find include file <iostream> // But it still works?!?! |
|
|
Could you, please, Ctrl+Hover Mouse above failed include and provide
screenshot.
You will see which paths were analyzed. Paths are taken from
Tools->Options->C++->Code Assistance + project properties
Vladimir.
monkeytroy wrote:
| Quote: | I am having the same problem with NetBeans 6.7.1 on Mac OSX 10.5.8.
My helloworld app will build and run fine, but the includes are highlighted in red and report "cannot find include file <iostream>" or <cstdlib> or whatever else should be found.
As described above, I can then do a build and run and everything works... NB just reports, in the editor, that they cannot be found.
|
|
|
| Back to top |
|
 |
spera_82
Joined: 16 Oct 2009 Posts: 1
|
Posted: Fri Oct 16, 2009 11:36 am Post subject: ... |
|
|
Hi!
i've solved this problem in this way:
1.right-click on project name
2.click properties
3.go to c++ compiler
4.find include directories line and set here where your include directories are (e.g. "C:/cygwin/lib/gcc/i686-pc-cygwin/3.4.4/include/c++")
5. the red mark disappear in this way!
Bye!
|
|
| Back to top |
|
 |
songryong
Joined: 21 Oct 2009 Posts: 1
|
Posted: Wed Oct 21, 2009 10:54 am Post subject: |
|
|
the properties is not appearing every time i click it. But when i click the properties of a java project it appears.
Why?
|
|
| Back to top |
|
 |
rwerp
Joined: 16 Jan 2010 Posts: 3
|
Posted: Sat Jan 16, 2010 3:31 pm Post subject: |
|
|
I have the same problem in Netbeans 6.8. In ext/new_allocator.h, Netbeans code assistance cannot resolve
#include <new>
when the file in question is in include/c++ Cygwin dir. I attach the screenshot.
---------------------------------
EDIT: Resetting the include directory list for C++ code assistance and restarting the IDE resolved the problem for now.
| Description: |
|
| Filesize: |
37.37 KB |
| Viewed: |
25688 Time(s) |

|
|
|
| Back to top |
|
 |
rwerp
Joined: 16 Jan 2010 Posts: 3
|
|
| Back to top |
|
 |
dlmerryweather
Joined: 10 Feb 2010 Posts: 7
|
Posted: Wed Feb 10, 2010 9:50 pm Post subject: I'm getting the same thing on NB 6.8 on Mac 10.6 |
|
|
I'm getting the same thing on NB 6.8 on Mac 10.6
I've tried all the different suggestions, none seem to make a difference.
The only note I can give is this project was built from some existing code.
| Description: |
|
| Filesize: |
35.83 KB |
| Viewed: |
24665 Time(s) |

|
|
|
| Back to top |
|
 |
Vladimir Voskresensky Posted via mailing list.
|
Posted: Thu Feb 11, 2010 8:09 am Post subject: cannot find include file <iostream> // But it still works?!?! |
|
|
Hi,
Thanks for the screen shot.
I see several issues there:
1) in tooltip some directories are marked as red => IDE thinks, there
are no such folders on your disk.
Can you go into Tools->Options->C/C++->Code Assistance and ask IDE to
regenerate predefined include dirs (btw, have you started 6.8 with clean
userdir or imported old settings from previous version? Using clean
userdir often helps)
2) make sure that there is no postfix "(framework directory)"
3) looks like you have C++ code in C-source file, because "using"
keyword behind your tooltip is not painted as keyword. Can you check
properties of the file in Project view and replace C compiler with C++
compiler (or gcc to g++) if this is the case
Thanks,
Vladimir.
dlmerryweather wrote:
|
|
| Back to top |
|
 |
|