Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile a C++0x code on Eclipse CDT on mac?

Can someone point to flags and setup changes required for one to compile C++0x code on a Eclipse CDT on mac please ?

like image 800
Ajeet Ganga Avatar asked Mar 30 '26 02:03

Ajeet Ganga


1 Answers

To use C++0x in Eclipse CDT on OSX (in a managed make project):

  • Open the project properties
  • C/C++ Build
  • Settings
  • Change the "Command" field in "MacOS X C++ Linker" and in "GCC G++ Compiler" from g++ to c++ (before check that c++ is clang++ with "c++ --version" in a shell)
  • Add "-std=c++0x -stdlib=libc++" in the "Miscellaneous" parameters of "GCC G++ Compiler"
  • Add "-stdlib=libc++" in the MIscellaneous "Linker flags" parameters of "MacOS X C++ Linker"
  • Open the "Discovery options", select the "GCC C++ compile" change g++ to c++ and add -std=c++0x to the "Compiler invocation arguments"
  • Add "/usr/include/c++/v1" to the "includes" in "Paths and Symbols" in C/C++ General
like image 97
Marco Avatar answered Apr 02 '26 12:04

Marco