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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:54:30+00:00 2026-05-21T13:54:30+00:00

I have this C++ project which compiles using a Makefile, and sometimes when (

  • 0

I have this C++ project which compiles using a Makefile, and sometimes when (my guess) there are some missing includes, I get a cryptic “error 2” message and the make process stops.
I suspect the missing includes because this is the third times it happens when I included a non-existent header file.

It looks like this:

---- Build tmp/foo.o ----
---- Build tmp/bar.o ----
---- Build tmp/toto.o ----
---- Build tmp/tata.o ----
make: *** [build_Project] Error 2

This is driving me nuts, because even using verbose commands (where each g++ invocation is showed), I can’t see anything.
I expected the guy to throw up some erroneous messages like “can’t find header X” or “undefined reference to Y“, but there’s nothing.

My compiling options for gcc are -O0 -Wall -Werror -Wno-write-strings -fno-rtti -fno-exceptions, if this helps.

Ah, and we use the Makefile trick of including dependencies:

ifneq ($(strip $(DEPENDS)),)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
endif
endif

( see here and here for more information )

Although this is documented stuff, I suspect my problem has something to do with this dependencies inclusion.

If you already stumbled on this issue, feel free to comment on this…

Thanks in advance.

edit:
Okay, after a bit of playing, suppressing the - in front of -include $(DEPENDS) gives me some more info (the makefile does stop on the missing included file).

make[1]: *** No rule to make target « foo.h », necessary for « tmp/bar.d ». Stop.

Now the drawback is that when I launch make for the first time, I get a missing bar.d file message for each dependency file that should be included (which was why we put the - in the first place).
Any solution?

  • 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-21T13:54:30+00:00Added an answer on May 21, 2026 at 1:54 pm

    Ok my edit solved the problem: placing a dash - in front of include hides the error messages coming from the dependency generation.

    Note for later: don’t try to outsmart Make.

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

Sidebar

Related Questions

I have a project in c# which uses bindings to use some c++ code.
I'm new to the world of Makefile writing. I have a C project which
I have a makefile project that builds and links a DLL, using the command-line
We are using Hudson with git. We have a build/test server which compiles our
I have this large C++ project that I need to build on a platform
I have this tiny Qt project with a project file like this: TEMPLATE =
We have this constant discussion in our project as to the granularity of our
In the past, I have not really used namespaces, but in this project I
So for this one project, we have a bunch of queries that are executed
I have a setup project for my C# program, and this setup project has

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.