NetBeans Forums

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

includes in header files not found

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
derari



Joined: 21 Dec 2011
Posts: 1

PostPosted: Wed Dec 21, 2011 10:52 am    Post subject: includes in header files not found Reply with quote

Hello,

I have a Maven project with some C/C++ files, everything works so far except for Netbeans' auto correction.

A simple #include <windows.h> does not work in .h files, the same goes for files that have to be found via Options>C>Code Assistance. The errors says
Quote:
Cannot find include file <windows.h>
For extra info hold Ctrl and move mouse over include directive
----
(Alt-Enter shows hints)


Alt-Enter shows the same message, Ctrl shows
Quote:
Unresolved directive #include <windows.h>


Including the same files in .c or .cpp files works fine.

What could be causing this?

Regards,
Arian
Back to top
Vladimir Voskresensky - O
Posted via mailing list.





PostPosted: Wed Dec 21, 2011 4:15 pm    Post subject: includes in header files not found Reply with quote

After inclusion into cpp file, please, Alt-Enter to see searched paths.
Probably your header is not included into any other source files? => then it's
orphan header which doesn't have compile context.
Orphan headers use include paths settings from project level from C++ compiler.

Thanks,
Vladimir.

On 21.12.11 14:52, derari wrote:
Quote:
Hello,

I have a Maven project with some C/C++ files, everything works so far except for Netbeans' auto correction.

A simple #include<windows.h> does not work in .h files, the same goes for files that have to be found via Options>C>Code Assistance. The errors says

Quote:
Cannot find include file<windows.h>
For extra info hold Ctrl and move mouse over include directive
----
(Alt-Enter shows hints)

Alt-Enter shows the same message, Ctrl shows

Quote:
Unresolved directive #include<windows.h>

Including the same files in .c or .cpp files works fine.

What could be causing this?

Regards,
Arian



Back to top
speedogoo



Joined: 23 Dec 2011
Posts: 2

PostPosted: Fri Dec 23, 2011 10:30 am    Post subject: Reply with quote

But even if it's not included in any C/C++ project, it should be able to find include path from the global setting in Options | C/C++ | Code Assistance?

However, here even stdio.h cannot be recognized.



NetBeans.png
 Description:
 Filesize:  28.51 KB
 Viewed:  4228 Time(s)

NetBeans.png


Back to top
Vladimir Voskresensky - O
Posted via mailing list.





PostPosted: Fri Dec 23, 2011 10:36 am    Post subject: includes in header files not found Reply with quote

On 23.12.11 14:30, speedogoo wrote:
Quote:
But even if it's not included in any C/C++ project, it should be able to find include path from the global setting in Options | C/C++ | Code Assistance?

However, here even stdio.h cannot be recognized.
I agree.
Could you, please, file a bug that in orphan headers standard system includes
are broken.

Thanks!
Vladimir.
Quote:




Attachments:
http://forums.netbeans.org//files/netbeans_803.png
Back to top
speedogoo



Joined: 23 Dec 2011
Posts: 2

PostPosted: Fri Dec 23, 2011 10:43 am    Post subject: Reply with quote

Bug filed at http://netbeans.org/bugzilla/show_bug.cgi?id=206663.
Back to top
Vladimir Voskresensky - O
Posted via mailing list.





PostPosted: Fri Dec 23, 2011 11:37 am    Post subject: includes in header files not found Reply with quote

Thanks!

On 23.12.11 14:43, speedogoo wrote:
Quote:
Bug filed at http://netbeans.org/bugzilla/show_bug.cgi?id=206663.



Back to top
kevstev01



Joined: 11 Sep 2012
Posts: 1

PostPosted: Tue Sep 11, 2012 9:46 am    Post subject: Relative paths Reply with quote

posted here in error - moved to bug report

I have found that using C/C++ -> Project Options -> File Path Mode ->Always Relative (the default) requires that the MinGW\include path is added to the project Code Assistance->C Compiler->Include Directories as a relative path to enable the editor to 'see' standard system includes. (running NB7.2 on Windows 7) even though the non-relative path is included in the NB default include paths, and the 'CTRL + mouse over' search path hints show the directory is being searched when it is not.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
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
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo