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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:33:41+00:00 2026-06-04T12:33:41+00:00

I am able to compile a single file using gcc with -std=c++0x option. But

  • 0

I am able to compile a single file using gcc with -std=c++0x option. But I can’t do this through makefile. Here are the set of flags in my makefile (which after make complains about c++11 keywords):

MACHINE = $(shell echo `uname -s`-`uname -m` | sed "s/ //g")
CCC     = CC
CCC     = g++
CFLAGS  = -O3
CFLAGS  = -std=c++0x
CFLAGS  = -pg -D_DEBUG -g -c -Wall
LFLAGS  = -O
LFLAGS  = -pg -g

What am I missing?

Edit:
I changed it to the following, but I still get compile errors, which I don’t get with command line gcc invocation.

CXXFLAGS=-O3 -std=c++0x -pg -D_DEBUG -g -c -Wall
  • 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-04T12:33:43+00:00Added an answer on June 4, 2026 at 12:33 pm

    This way your makefile will use all of your CFLAGS:

    CFLAGS=-O3 -std=c++0x -pg -D_DEBUG -g -c -Wall
    

    You’re overriding them with each “CFLAGS=…” declaration.

    Moreover, it should be CXXFLAGS, not CFLAGS. CFLAGS is for C applications.

    As @Florian Sowade said, you could use CFLAGS += -O3 -std.... (or CXXFLAGS..), so that users can provide their own flags when executing make.

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

Sidebar

Related Questions

Assuming a single machine with 8 cores. In Haskell, you can compile using the
I am able to use: C:\Program Files (x86)\Java>javac -classpath mail.jar myFile.java to compile,but when
Here is my XAML for a TabItem. I want to be able to set
I am not able to compile the following program because of cyclic dependency between
Hi all I have installed buildroot toolchain and am able to compile simple Hello
I have a long-standing application that I'm normally able to compile equally well from
Why is the compiler not able to automatically convert the values in this expression
I'm currently trying to write a multiple-file Python (2.6.5) game using PyGame. The problem
I'd like to be able to compile an Android app on my desktop, upload
I have a CPP source file that uses #if / #endif to compile out

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.