Using -std=c++14 in osx

#1

I just want to compile my oF project on c++14 environment.
I added PROJECT_CFLAGS in config.make file in my project but it didn’t worked (log says -std=c++11)

oF version is v0.9.8 release.

Any advices? or am I doing wrong?

Thanks,
Joe

#2

If you use Xcode, you can go to the Build Settings and find C++ Language Dialect and change the settings to C++14[-std=c++14].

#3

Thanks! In XCode it works.

But I usually do 'make' directly from console when building the project.
Any solution for this?

Thanks,
Joe

#4

there’s no way right now to change this per project. it’s a hardcoded value that you can change in libs/openFrameworksCompiled/project/osx/config.osx.default.mk line 132:

PLATFORM_CXXFLAGS += -std=c++11
1 Like
#5

@arturo
Thank you for your info!!

#6

I’m using XCode 10 (now 11) and the only thing that really worked for me was setting
CLANG_CXX_LANGUAGE_STANDARD[arch=x86_64] = c++14
in the file
$OF_ROOT/libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig

Hope this helps someone.