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

  • SEARCH
  • Home
  • 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 7688013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:49:44+00:00 2026-05-31T19:49:44+00:00

I am programming for a big project, so I cooperate with others. To make

  • 0

I am programming for a big project, so I cooperate with others. To make the directory easily managed, my directory is like below:

project:
--include (header files from others supplied for me)
--lib (libraries from others supplied for me)
--L3_CVS  (this folder include all my files)
   -- Makefile 
   -- sourceFile (all my source files here)
       -- include_private(all header files used only by myself)
       -- appl (all my C files here)

if I want to include a .h file in my .c file, do I need to write in .c file ” #include “../include-private/XX.h” “???
what if i just write in .c ” include “XX.h” “?

Because I need to use the .h files in “include folder” which others supply for me, how could I write in my .c files to include these .h files??

my makefile is below:

how to include .h document in makefile

thank you for your help!!!

  • 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-05-31T19:49:45+00:00Added an answer on May 31, 2026 at 7:49 pm

    Depends on the compiler, but typically, you’ll want to add the following line:

     CFLAGS += -I../include-private
    

    CFLAGS is a variable that make uses to add command-line options for the C compiler (“C” flags). For C++, you need to use CXXFLAGS. If I’m using C and C++ in the same project, I’ll typically create a variable called INCLUDES, and use it like this:

     INCLUDES = -I../include-private
    
     CFLAGS += $(INCLUDES)
     CXXFLAGS += $(INCLUDES)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am programming for a big project, so I cooperate with others. To make
I'd like to implement a big int class in C++ as a programming exercise—a
I'm writing an editor for large archive files (see below) of 4GB+, in native&managed
When programming a big project, you often need the same pieces of code in
I have taken Problem #12 from Project Euler as a programming exercise and to
Programming Student here...trying to work on a project but I'm stuck. The project is
I try to realize a little game project to dive deeper into OO programming
I have a programming project with highly intensive use of malloc/free functions. It has
I am following a book (Big Nerd Ranch IOS Programming) and the version of
I am doing my Computing Science project. I am doing Multiprocessor programming using C.

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.