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 9021495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:16:08+00:00 2026-06-16T05:16:08+00:00

I am trying to make a project using a library named BigInt. My file

  • 0

I am trying to make a project using a library named BigInt. My file structure is:

/Users/wen/Projects/challenge/fibonacci3/fibonacci3.cpp
/Users/wen/Projects/challenge/fibonacci3/Makefile
/Users/wen/Projects/include/bigint/<.cc files and .hh files>
/Users/wen/Projects/include/bigint/Makefile

The Fibonacci3 Makefile is as of

LD_FLAGS = 
CC_FLAGS = 

# Include libraries

include /Users/wen/Projects/include/bigint/Makefile

# Build object files

%.o: %.cc %.cpp $(library-cpp)
    g++ -c -o $@ $(CC_FLAGS)

# Link object files

fibonacci3: fibonacci3.o $(library-objects)
    g++ -o $@ $(LD_FLAGS)

and the bigint Makefile is as of (shortened)

# Mention default target.
all:

# Implicit rule to compile C++ files.  Modify to your taste.
%.o: %.cc
    g++ -c -O2 -Wall -Wextra -pedantic $<

# Components of the library.

library-cpp = \
    BigUnsigned.cc \
    BigInteger.cc \
    BigIntegerAlgorithms.cc \
    BigUnsignedInABase.cc \
    BigIntegerUtils.cc \

library-objects = \
    BigUnsigned.o \
    BigInteger.o \
    BigIntegerAlgorithms.o \
    BigUnsignedInABase.o \
    BigIntegerUtils.o \

library-headers = \
    NumberlikeArray.hh \
    BigUnsigned.hh \
    BigInteger.hh \
    BigIntegerAlgorithms.hh \
    BigUnsignedInABase.hh \
    BigIntegerLibrary.hh \

however, make reports that it could not find a rule for a header file?

make: *** No rule to make target `NumberlikeArray.hh', needed by `BigUnsigned.o'.  Stop.
[Finished in 0.0s with exit code 2]

What is happening here? Headers are supposed to be included, not compiled, so why is make asking for one?

Thanks in advance!

Solution:

Instead of including the makefile, compile the sources in my own makefile. It worked! Thanks again.

  • 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-16T05:16:09+00:00Added an answer on June 16, 2026 at 5:16 am

    The make program expects all files to be in the current directory. Since you include the second makefile into the current makefile, all files in that are relative to the current directory as well. You have to make sure that the files in the included makefile contains the correct paths.

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

Sidebar

Related Questions

I've been trying to make an android library project, and while the build process
I'm trying to create a project as a shared library in OS X using
I am trying to compile my project with a library called SDL_draw using cmake
I am trying to make use of a C library in an iPhone project.
I'm trying to move a project over to using Entity Framework, but to make
I am trying to make some project in which i want a text box
I am trying to make a project with packages of classes with different access
I'm trying to make my project compile under GCC (Visual Studio compiles it flawlessly).
I am trying to make a tictactoe project in jQuery and I am having
I am an amateur mac user and I'm trying to make a c++ project

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.