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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:35:36+00:00 2026-05-11T12:35:36+00:00

I have built a make file for my project, and it works (everything compiles)

  • 0

I have built a make file for my project, and it works (everything compiles) but it gives these irritating error messages:

make: Circular zpr.c <- zpr.o dependency dropped. gcc -Wall   -c -o zpr.o zpr.c make: Circular readjpeg.c <- readjpeg.o dependency dropped. gcc -Wall   -c -o readjpeg.o readjpeg.c make: Circular readppm.c <- readppm.o dependency dropped. gcc -Wall   -c -o readppm.o readppm.c make: Circular SceneNode.cpp <- SceneNode.o dependency dropped. g++    -c -o SceneNode.o SceneNode.cpp make: Circular BoundingBoxNode.cpp <- BoundingBoxNode.o dependency dropped. g++    -c -o BoundingBoxNode.o BoundingBoxNode.cpp make: Circular GeometryNode.cpp <- GeometryNode.o dependency dropped. g++    -c -o GeometryNode.o GeometryNode.cpp make: Circular SceneGraph.cpp <- SceneGraph.o dependency dropped. g++    -c -o SceneGraph.o SceneGraph.cpp make: Circular testgraph.cpp <- testgraph.o dependency dropped. g++    -c -o testgraph.o testgraph.cpp 

My makefile is not complicated at all so hopefully someone can spot the error.

GXX=g++ CC=gcc CFLAGS=-Wall  LIBS=-lGL -lglut -ljpeg  OBJS=helpers.o loadobj.o zpr.o readjpeg.o readppm.o SceneNode.o BoundingBoxNode.o GeometryNode.o SceneGraph.o  testgraph.o OBJS2=testgraph.o SceneGraph.o GeometryNode.o BoundingBox.o SceneNode.o readppm.o readjpeg.o zpr.o loadobj.o helpers.o SRCS=testgraph.cpp SceneGraph.cpp SceneNode.cpp  .o.cpp:     $(GXX) $(CFLAGS) -c $<  .o.c:     $(CC) $(CFLAGS) -c $<  testgraph: $(OBJS)     $(GXX) $(LIBS) $(OBJS) -o testgraph  clean:     rm *.o 
  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T12:35:37+00:00Added an answer on May 11, 2026 at 12:35 pm

    Your implicit rules are the culprit. They have the extensions listed in the reverse order of how they are understood by make.

    .o.c: 

    tells make that .c files are created from .o files. Since there is already a rule that says that .o files are created from .c files, you have a circular dependencies and therefore the errors.

    The solution is (or should be, assuming a reasonably configured make) simple.

    You don’t (usually) need to specify your own rules for compilation in really common cases, such as C++ sources. It would be simpler to just specify something like:

    CFLAGS=-Wall LOADLIBES=-lGL -lglut -ljpeg  OBJS=helpers.o loadobj.o zpr.o readjpeg.o readppm.o SceneNode.o \    BoundingBoxNode.o GeometryNode.o SceneGraph.o  testgraph.o   all: testgraph  testgraph: $(OBJS) 

    This is likely to also help you avoid two errors.

    1. The rules you wrote say that .o files are created from .c files, which is backwards. But the correct rules already exist in nearly all versions of make.

    2. You have listed the libraries ahead of the object files. This works by accident on some platforms that use ELF format objects. But it is still wrong. List libraries after objects because libraries are only loaded to satisfy undefined externals.

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

Sidebar

Related Questions

I have a small RIA that I built as a learning/make-my-life-easier project that uses
I have some project with file: src/Test.cpp . Now I make subproject for it
I have built ICS source using make -j4, then I have modified the Music
I'm developing an application with node.js and socket.io. I have built a small-scale project
I have an Eclipse project. All testcases are in one *.cpp file. The problem
Is there any way to make an environment variable substituion in a project file
So I have started a new Qt console project; everything so far has been
I have a maven library project with some classes to deal xml messages. Whenever
I have this setup currently: Project A outputs a war file - has a
I have a simple Makefile: default: @make build @make run build: @javac Test.java >

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.