@Mathias_Westerdahl, so to recap the libc++ issue.
I want to use for instance unordered_map. I write #include <unordered_map>
and get this error:
Description Resource Path Location Type
clang++ -c -arch x86_64 -target x86_64-apple-darwin11 -isysroot /opt/MacOSX.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -DDM_PLATFORM_OSX -I/tmp/upload8882111693246949285/openal/include -F/tmp/upload8882111693246949285/openal/lib/x86_64-osx -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/include -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/sdk/include /tmp/upload8882111693246949285/openal/src/extension.cpp -o/var/extender/builds/build8151566694450167681/extension.cpp_0.o
In file included from /tmp/upload8882111693246949285/openal/src/extension.cpp:12:
/tmp/upload8882111693246949285/openal/src/openal.h:7:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
^
1 error generated.
openal.h /extension-openal/content/openal/src line 1 Problem
fatal error: 'unordered_map' file not found openal.h /extension-openal/content/openal/src line 7 Problem
Fair enough, now I need to specify that I want libc++ during the compilation. I add it to the flags
section.
name: "openal"
platforms:
x86_64-osx:
context:
flags: ["-std=c++11", "-stdlib=libc++"]
frameworks: []
linkFlags: []
libs: []
And get the same error:
Description Resource Path Location Type
clang++ -c -arch i386 -target x86_64-apple-darwin11 -isysroot /opt/MacOSX.sdk/ -m32 -O2 -g -mmacosx-version-min=10.7 -DDM_PLATFORM_OSX -DLUA_BYTECODE_ENABLE -I/tmp/upload3097681066102365404/openal/include -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/include -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/sdk/include /tmp/upload3097681066102365404/openal/src/extension.cpp -o/var/extender/builds/build4031484822964348167/extension.cpp_0.o
In file included from /tmp/upload3097681066102365404/openal/src/extension.cpp:12:
/tmp/upload3097681066102365404/openal/src/openal.h:7:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
^
1 error generated.
openal.h /extension-openal/content/openal/src line 1 Problem
fatal error: 'unordered_map' file not found openal.h /extension-openal/content/openal/src line 7 Problem
For some reason I don’t see the specified flags in the command output.
But if I add to linkFlags.
name: "openal"
platforms:
x86_64-osx:
context:
flags: ["-std=c++11", "-stdlib=libc++"]
frameworks: []
linkFlags: ["-stdlib=libc++"]
libs: []
The error message changes
Description Resource Path Location Type
clang++ -c -arch x86_64 -target x86_64-apple-darwin11 -isysroot /opt/MacOSX.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -DDM_PLATFORM_OSX -std=c++11 -stdlib=libc++ -I/tmp/upload691423238232034599/openal/include -F/tmp/upload691423238232034599/openal/lib/x86_64-osx -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/include -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/sdk/include /tmp/upload691423238232034599/openal/src/extension.cpp -o/var/extender/builds/build3582109968007015917/extension.cpp_0.o
clang++ -c -arch x86_64 -target x86_64-apple-darwin11 -isysroot /opt/MacOSX.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -DDM_PLATFORM_OSX -std=c++11 -stdlib=libc++ -I/tmp/upload691423238232034599/openal/include -F/tmp/upload691423238232034599/openal/lib/x86_64-osx -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/include -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/sdk/include /tmp/upload691423238232034599/openal/src/openal.cpp -o/var/extender/builds/build3582109968007015917/openal.cpp_1.o
llvm-ar rcs /var/extender/builds/build3582109968007015917/lib27f64f14-e0c6-439f-8a45-f3cc3eec2a6b.a /var/extender/builds/build3582109968007015917/extension.cpp_0.o /var/extender/builds/build3582109968007015917/openal.cpp_1.o
clang++ -c -arch x86_64 -target x86_64-apple-darwin11 -isysroot /opt/MacOSX.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -DDM_PLATFORM_OSX -std=c++11 -stdlib=libc++ -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/include -I/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/sdk/include /var/extender/builds/build3582109968007015917/main.cpp -o/var/extender/builds/build3582109968007015917/main_tmpc1e02db3-f348-47f4-b805-ab40b742aa18.o
clang++ -arch x86_64 -target x86_64-apple-darwin11 -isysroot /opt/MacOSX.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -o /var/extender/builds/build3582109968007015917/dmengine -stdlib=libc++ -L/var/extender/builds/build3582109968007015917 -L/tmp/upload691423238232034599/openal/lib/x86_64-osx -l27f64f14-e0c6-439f-8a45-f3cc3eec2a6b -F/var/extender/builds/build3582109968007015917 -F/tmp/upload691423238232034599/openal/lib/x86_64-osx -F/tmp/upload691423238232034599/openal/lib/x86_64-osx -framework Foundation -framework AppKit -framework Cocoa -framework OpenGL -framework OpenAL -framework AGL -framework IOKit -framework Carbon -framework CoreVideo -L/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/lib/x86_64-darwin -L/var/extender/sdk/1afccdb2cd42ca3bc7612a0496dfa6d434a8ebf9/defoldsdk/ext/lib/x86_64-darwin -lengine -ladtruthext -lfacebookext -liapext -lpushext -liacext -lrecord -lgameobject -lddf -lresource -lgamesys -lgraphics -lphysics -lBulletDynamics -lBulletCollision -lLinearMath -lBox2D -lrender -lscript -llua -lextension -lhid -linput -lparticle -lrig -ldlib -ldmglfw -lgui -ltracking -lcrashext -lsound -ltremolo -lvpx -lliveupdate /var/extender/builds/build3582109968007015917/main_tmpc1e02db3-f348-47f4-b805-ab40b742aa18.o
Undefined symbols for architecture x86_64:
"__ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base", referenced from:
__ZNSt8_Rb_treeIySt4pairIKyjESt10_Select1stIS2_ESt4lessIyESaIS2_EE16_M_insert_uniqueESt17_Rb_tree_iteratorIS2_ERKS2_ in libddf.a(ddf_loadcontext_5.o)
__ZNSt8_Rb_treeIySt4pairIKyjESt10_Select1stIS2_ESt4lessIyESaIS2_EE16_M_insert_uniqueERKS2_ in libddf.a(ddf_loadcontext_5.o)
"__ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base", referenced from:
__ZNSt8_Rb_treeIySt4pairIKyjESt10_Select1stIS2_ESt4lessIyESaIS2_EE16_M_insert_uniqueESt17_Rb_tree_iteratorIS2_ERKS2_ in libddf.a(ddf_loadcontext_5.o)
"__ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_", referenced from:
__ZNSt8_Rb_treeIySt4pairIKyjESt10_Select1stIS2_ESt4lessIyESaIS2_EE16_M_insert_uniqueESt17_Rb_tree_iteratorIS2_ERKS2_ in libddf.a(ddf_loadcontext_5.o)
__ZNSt8_Rb_treeIySt4pairIKyjESt10_Select1stIS2_ESt4lessIyESaIS2_EE16_M_insert_uniqueERKS2_ in libddf.a(ddf_loadcontext_5.o)
ld: symbol(s) not found for architecture x86_64
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
ext.manifest /extension-openal/content/openal line 1 Problem
This time the compiler flags are present, but linking fails due to some incompatibility with libddf? What is it, anyway?
I know these C++ features are not super crucial, but they make coding easier.