NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
h9uest
Joined: 31 Mar 2011 Posts: 4
|
Posted: Thu Mar 31, 2011 12:56 am Post subject: Netbeans: header file path configuration for Linux C++ project |
|
|
Hi people:
I used to program in C++ with vim, but now want to make a shift to Netbeans. I typically work with Makefile projects (a tar.gz package containing source code and Makefile). I imported the project into Netbeans but have the following problem:
In the Makefile project: in source file, say, main.cc, I have | Code: | | #include "include/header_1.h" | , where "include" is a sub directory in my project root directory and header_1.h is a header file defined by me. In the Makefile, I simply use -I option to let the compiler find the header files. No problem at all. But when I try to build the project with Netbeans, it tells me it "cannot find" the header file. How can I make Netbeans find the header file?
The even more weird thing is, although netbeans tells me this error and highlight all "unresolved identifiers", when I build the app, it works! When I run it, it also works (still highlighting the unresolved identifiers)! What the heck is this?
Thanks in advance |
|
| Back to top |
|
 |
h9uest
Joined: 31 Mar 2011 Posts: 4
|
Posted: Thu Mar 31, 2011 12:29 pm Post subject: |
|
|
Anyone??
Thanks |
|
| Back to top |
|
 |
Vladimir Voskresensky Posted via mailing list.
|
Posted: Tue Apr 05, 2011 6:53 pm Post subject: Netbeans: header file path configuration for Linux C++ project |
|
|
| Quote: |
Hi people:
I used to program in C++ with vim, but now want to make a shift to Netbeans. I typically work with Makefile projects (a tar.gz package containing source code and Makefile). I imported the project into Netbeans but have the following problem:
In the Makefile project: in source file, say, main.cc, I have
Code:
#include "include/header_1.h"
, where "include" is a sub directory in my project root directory and header_1.h is a header file defined by me. In the Makefile, I simply use -I option to let the compiler find the header files. No problem at all. But when I try to build the project with Netbeans, it tells me it "cannot find" the header file. How can I make Netbeans find the header file?
The even more weird thing is, although netbeans tells me this error and highlight all "unresolved identifiers", when I build the app, it works! When I run it, it also works (still highlighting the unresolved identifiers)! What the heck is this?
Thanks in advance
| Hi.
You'd better ask C++ related topics in dedicated C++ forum/mail list
(address-removed).
As to your question:
- in project properties you can always specify Additional include
directives in C++ section
Thanks,
Vladimir. |
|
| Back to top |
|
 |
chjan
Joined: 09 Dec 2011 Posts: 4
|
Posted: Sun Apr 29, 2012 10:42 am Post subject: Netbeans will not take header file paths at all |
|
|
I am running through a couple of tutorials on C compilation with Netbeans. Whatever I do, I cannot convince Netbeans to grasp even the most simple paths to the files. The only solution that works is to put the header file in the same physical folder as the cpp files. Then everything works well.
So, there seem to be a serious weakness i the C module of Netbeans, given all those questions of similar nature on the net.
Header files are not found by Netbeans!
I just wonder; is this C/C++ module in use at all ? Spending "days" on trying to setup a simple path seems like a cold wind from the days of old.
If anyone has a waterproof remedy, then many thanks beforehand. I am using NB 7+ on Win7, mostly for Java and Android (in which context NB is just perfect!).
cheers
Carl |
|
| Back to top |
|
 |
chjan
Joined: 09 Dec 2011 Posts: 4
|
Posted: Sun Apr 29, 2012 10:43 am Post subject: Netbeans will not take header file paths at all |
|
|
UPDATE: YES, THE NETBEANS FEATURE: RIGHT CLICK PROPERTIES\BUILD\C COMPILER\INCLUDE DIRECTORIES DOES NOT WORK. PATHS ARE NOT TAKEN INTO ACCOUNT BY COMPILER. HEADER FILES ARE NOT FOUND, REGARDLESS. THIS MODULE NEEDS REVISION!
HOWEVER, FOR ANYONE ELSE WITH THIS PROBLEM, I GOT AROUND IT BY INCLUDING HEADER FILES IN THE FOLLOWING MANNER:
#INCLUDE "SUBFOLDER/SUBSUBFOLDER/MYHEADERFILE.H"
INSTEAD OF JUST WRITING
#INCLUDE "MYHEADERFILE.H"
...............
I am new to this forum, so; How to ensure that bugs are put into someones TODO list ? Also, is there a responsible for this C module that I can speak to about these things ?
...............
MY PREVIOUS TEXT:
I am running through a couple of tutorials on C compilation with Netbeans. Whatever I do, I cannot convince Netbeans to grasp even the most simple paths to the files. The only solution that works is to put the header file in the same physical folder as the cpp files. Then everything works well.
So, there seem to be a serious weakness i the C module of Netbeans, given all those questions of similar nature on the net.
Header files are not found by Netbeans!
I just wonder; is this C/C++ module in use at all ? Spending "days" on trying to setup a simple path seems like a cold wind from the days of old.
If anyone has a waterproof remedy, then many thanks beforehand. I am using NB 7+ on Win7, mostly for Java and Android (in which context NB is just perfect!).
cheers
Carl
Last edited by chjan on Sun Apr 29, 2012 11:03 am; edited 1 time in total |
|
| Back to top |
|
 |
chjan
Joined: 09 Dec 2011 Posts: 4
|
Posted: Sun Apr 29, 2012 10:43 am Post subject: Netbeans will not take header file paths at all |
|
|
I am running through a couple of tutorials on C compilation with Netbeans. Whatever I do, I cannot convince Netbeans to grasp even the most simple paths to the files. The only solution that works is to put the header file in the same physical folder as the cpp files. Then everything works well.
So, there seem to be a serious weakness i the C module of Netbeans, given all those questions of similar nature on the net.
Header files are not found by Netbeans!
I just wonder; is this C/C++ module in use at all ? Spending "days" on trying to setup a simple path seems like a cold wind from the days of old.
If anyone has a waterproof remedy, then many thanks beforehand. I am using NB 7+ on Win7, mostly for Java and Android (in which context NB is just perfect!).
cheers
Carl |
|
| Back to top |
|
 |
|
|
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
|
|