FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

cannot find include file <iostream> // But it still works?!?!
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
SystemOverload



Joined: 17 Mar 2009
Posts: 6
Location: United Kingdom

PostPosted: Wed Mar 18, 2009 9:05 pm    Post subject: cannot find include file <iostream> // But it still works?!?! Reply with 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
View user's profile Send private message
Vladimir Voskresensky
Posted via mailing list.





PostPosted: Thu Mar 19, 2009 12:06 pm    Post subject: cannot find include file <iostream> // But it still works?!?! Reply with quote

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

PostPosted: Thu Mar 19, 2009 1:00 pm    Post subject: Reply with 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 Smile
Back to top
View user's profile Send private message
Vladimir Voskresensky
Posted via mailing list.





PostPosted: Thu Mar 19, 2009 5:58 pm    Post subject: cannot find include file <iostream> // But it still works?!?! Reply with quote

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 Smile
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

PostPosted: Fri Aug 21, 2009 12:15 am    Post subject: Same basic issue and tearing my hair out Reply with quote

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
View user's profile Send private message
Alexey Vladykin
Posted via mailing list.





PostPosted: Wed Aug 26, 2009 9:18 pm    Post subject: cannot find include file <iostream> // But it still works?!?! Reply with quote

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

PostPosted: Thu Aug 27, 2009 8:02 am    Post subject: Awesome Reply with quote

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
View user's profile Send private message
monkeytroy



Joined: 17 Sep 2009
Posts: 1

PostPosted: Thu Sep 17, 2009 6:52 pm    Post subject: same prob with mac Reply with 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
View user's profile Send private message
Vladimir Voskresensky
Posted via mailing list.





PostPosted: Fri Sep 18, 2009 8:56 am    Post subject: cannot find include file <iostream> // But it still works?!?! Reply with quote

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

PostPosted: Fri Oct 16, 2009 11:36 am    Post subject: ... Reply with quote

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
View user's profile Send private message
songryong



Joined: 21 Oct 2009
Posts: 1

PostPosted: Wed Oct 21, 2009 10:54 am    Post subject: Reply with quote

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
View user's profile Send private message
rwerp



Joined: 16 Jan 2010
Posts: 3

PostPosted: Sat Jan 16, 2010 3:31 pm    Post subject: Reply with quote

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.



code_assistance_fail.PNG
 Description:
Screenshot.
 Filesize:  37.37 KB
 Viewed:  25688 Time(s)

code_assistance_fail.PNG


Back to top
View user's profile Send private message
rwerp



Joined: 16 Jan 2010
Posts: 3

PostPosted: Sun Jan 17, 2010 3:14 pm    Post subject: Reply with quote

The problem appeared again Sad

Should I install mingw C++? Does netbeans work better with it than with Cygwin?



code_assistance_fail2.PNG
 Description:
Screenshot.
 Filesize:  83.84 KB
 Viewed:  25655 Time(s)

code_assistance_fail2.PNG


Back to top
View user's profile Send private message
dlmerryweather



Joined: 10 Feb 2010
Posts: 7

PostPosted: Wed Feb 10, 2010 9:50 pm    Post subject: I'm getting the same thing on NB 6.8 on Mac 10.6 Reply with quote

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.



Screen shot 2010-02-10 at 3.48.07 PM.png
 Description:
 Filesize:  35.83 KB
 Viewed:  24665 Time(s)

Screen shot 2010-02-10 at 3.48.07 PM.png


Back to top
View user's profile Send private message
Vladimir Voskresensky
Posted via mailing list.





PostPosted: Thu Feb 11, 2010 8:09 am    Post subject: cannot find include file <iostream> // But it still works?!?! Reply with quote

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:
Quote:
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.




Attachments:
http://forums.netbeans.org//files/screen_shot_2010_02_10_at_34807_pm_127.png

Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB