Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9313211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:49:27+00:00 2026-06-19T01:49:27+00:00

In netbeans I am creating a new folder and adding header files to it.

  • 0

In netbeans I am creating a new folder and adding header files to it.

Now when I include the header file within the newly created folder to another file by using:

#include "folder1/myheaderFile.h"

The compiler complains that it is unable to find the header file.

The error is:

main.cpp:31:39: fatal error: folder1/myheaderFile.h: No such file or directory

Is there some way out as I want to include the header files within a folder in my #include?

EDIT: Do i need to make a makefile for every folder?
Another EDIT:

When I right clicked on the error its showing
unresolved directive
#include
Analyzed system include paths:
/usr/include/C++/4.6
/usr/include/C++/4.6/x84_64_linux_gnu
/usr/include/C++/4.6/backward
/usr/lib/gnu/x86_64-linux-gnu/4.6/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu
/usr/include
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:49:28+00:00Added an answer on June 19, 2026 at 1:49 am

    Here’s for your convenience:

    The include file paths you have specified are for system-wide headers. Is the header you are including yours or downloaded/installed system-wide? Do you see the path of the header in the output?
    If you are including the header which is in a folder, from another folder, then you need to traverse back, i.e: #include "../folder/header.h"

    If this is a system folder, such as the ones residing in /usr/local/include in my system, all you have to do is

    #include <header.h>
    

    or if it resides in a sub-folder (quite often),

    #include <Libname/header.h>
    

    As long as you have set the include paths pointing at it, it should work.

    To setup the include paths and directories, see example: http://zetcode.com/articles/netbeanscdevelopment/ near the end of the page.

    Remember that when you hardcode paths, you need to take into consideration the current path of the file which is including the header.

    Alternatively, you can use cmake & make (don’t know what Netbeans uses), where you define everything your self.

    You can test with full path, i.e:

    #include "/home/user/project/folder/header.h
    

    or you can test from command line and set the include path.

    Hope it helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a new ruby gem using NetBeans as my IDE. The initial
When creating a new project in netbeans, if i select JAVA Desktop application, it
im new to hibernate! i have followed the netbeans tutorial on creating a hibernate
I'm creating an application in Swing using NetBeans. I would like to be able
i'm new with web service programming and i want to create,using netbeans 6, a
I'm creating a web app using NetBeans and Tomcat 7 and I wanted to
I am creating a Java Application using netBeans and Swing Gui Builder. I am
Netbeans is creating a class Main automatically when I create a new project. so
I am creating a JTree using the GUI builder in Netbeans and I can
New to NetBeans dev here. When I first created my project and began compiling,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.