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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:06:02+00:00 2026-05-26T17:06:02+00:00

I am trying to get C++11 features to compile on my Mac. I have

  • 0

I am trying to get C++11 features to compile on my Mac. I have tried two different things so far. First, the latest Xcode (4.2) claims to support “C++11 features” but when I try to compile this:

#include <iostream>

int main()
{
    using namespace std;
    int n = [] (int x, int y) { return x + y; }(5, 4);
    cout << n << endl;
}

I get an error, “expected expression,” for the first bracket ([). I’m guessing lambda expressions are not included in the new C++11 features?

Then, as a work around I downloaded gcc 4.6 binaries from http://hpc.sourceforge.net/ but when I use gcc-4.6 (/usr/local/bin/gcc-4.6 -std=c++0x test.cpp) I get:

Undefined symbols for architecture x86_64:
  "std::cout", referenced from:
      _main in cctnMUFF.o
...

I’m thinking it’s an issue with not finding the standard library?

Thanks!

  • 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-26T17:06:02+00:00Added an answer on May 26, 2026 at 5:06 pm

    XCode 4.2 ships with a late Clang 2.9, patched by Apple. It does not support lambda’s nor uniform initializers. Clang 3.0 doesn’t either, so you’ll have to wait until at least Clang 3.1 (which is due in 6 months from now).

    Alternatively, you could use Macports’ GCC 4.6 for lambda support.


    UPDATE to your update: you need to link with g++, or add -lstdc++ manually.

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

Sidebar

Related Questions

I'm still trying to get a hang of Perl's OOP features. I'm confused about
I'm trying to get YouTube feeds with the python gdata library. Authentication features work
i'm trying to get a first lisp program to work using the CLISP implementation,
I've been trying to get some features developed for my app which I don't
I have come across a weird compiler error (using VC2010) while trying to compile
I'm developing an iOS 4 application using latest SDK and XCode 4.2. I have
When trying to compile a feature detection algorithm I get the following compile error:
I am trying to get a vertex by using indexing-features, but only getting a
I am trying to get FileUpload feature working with Icefaces ace:fileEntry but my fileUploadListener
Im using xmpp4r and trying to get the hang of a basic chat feature

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.