What could cause clang to not find the unordered_map header? - c++

I'm trying to compile a program I found on the web using Clang++. The Makefile generates this command:
clang++ -c -arch x86_64 -msse3 -std=c++11 -stdlib=libstdc++
-Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type
-Wno-non-virtual-dtor -Wno-exit-time-destructors -Wformat -Wmissing-braces
-Wparentheses -Wno-switch -Wunused-function -Wunused-label -Wno-unused-parameter
-Wunused-variable -Wunused-value -Wno-empty-body -Wuninitialized -Wunknown-pragmas
-Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion
-Wint-conversion -Wno-shorten-64-to-32 -Wenum-conversion -Wno-newline-eof
-Wno-c++11-extensions -Wno-logical-op-parentheses -Wno-trigraphs
-Wno-invalid-offsetof -Wno-sign-conversion -Wdeprecated-declarations
-fmessage-length=0 -fno-exceptions -fstrict-aliasing -fvisibility=hidden
-fvisibility-inlines-hidden -funsafe-math-optimizations -ftrapping-math -fno-rtti
-fpascal-strings -fasm-blocks -O3 -Iinclude/ src/main.cpp
But I get
src/main.cpp:23:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
^
1 error generated.
If I compile a simple program that includes <unordered_map> running clang++ test.cpp, it compiles fine.
I'm on
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

I had the same issue when compiling glogg.
As the comments have pointed out. it was stdlib.
In the makefile after running qmake. Change this line from
CXXFLAGS = -g -Wextra -std=c++11 -DGLOGG_VERSION=\"`cat .tarball-version`\" -O2 -arch x86_64 -Wall -W $(DEFINES)
To this line below
CXXFLAGS = -g -Wextra -std=c++11 -stdlib=libc++ -DGLOGG_VERSION=\"`cat .tarball-version`\" -O2 -arch x86_64 -Wall -W $(DEFINES)
notice "-stdlib=libc++" was specified in the cxxflags. It's autospecified in the linker flags, I guess it also needs to be specified in for the C++ flags.

It says -Wno-c++11-extensions. What wrote that makefile?

Related

How to associate source files with dynamic library

I need to debug Postgres foreign data wrapper mysql_fdw.so. In Clion i try to attach postgres process.
Debugger attached to process 8818
In source code of fdw i try to set break points, but it says no executable code associated with this line.
How can i associate source code? Or can i debug this in another way?
compile commands:
gcc -g3 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -ggdb -O0 -fno-omit-frame-pointer -I/usr/local/mysql/include -g3 -D _MYSQL_LIBNAME=\"libmysqlclient.dylib\" -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -c -o mysql_fdw.o mysql_fdw.c
gcc -g3 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -ggdb -O0 -fno-omit-frame-pointer -bundle -multiply_defined suppress -o mysql_fdw.so connection.o option.o deparse.o mysql_query.o mysql_fdw.o -L/usr/local/pgsql/lib -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -Wl,-dead_strip_dylibs -bundle_loader /usr/local/pgsql/bin/postgres

Using clang to compile R packages on Windows

I've developing R packages that contain C++ code on Windows 10.
I wish to check for memory allocation errors. It sounds like the simplest path is to use clang++ with the -fsanitize=address option.
How do I configure R such that clang is the default compiler?
What I've done so far:
Install LLVM, adding binaries to the path
Set the following options in ~/.R/makevars:
CC = "path/to/llvm/bin/clang"
CXX = "path/to/llvm/bin/clang++"
CXX11 = "path/to/llvm/bin/clang++"
CXX14 = "path/to/llvm/bin/clang++"
CXXFLAGS = -O1 -g -fsanitize=address -fno-omit-frame-pointer
PKG_CXXFLAGS = -Og -fsanitize=address
LDFLAGS = -fsanitize=address
Within RStudio, run devtools::install(). I see:
- installing *source* package 'TreeTools' ...
** using staged installation
** libs
"path/to/llvm/bin/clang++" -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I'C:/Users/ms609/Documents/R/win-library/4.0/Rcpp/include' -Og -Wall -pedantic -mtune=generic -fsanitize=address -Wno-deprecated-declarations -O2 -Wall -gdwarf-2 -mfpmath=sse -msse2 -mstackrealign -c as_newick.cpp -o as_newick.o
"path/to/llvm/bin/clang++" -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I'C:/Users/ms609/Documents/R/win-library/4.0/Rcpp/include' -Og -Wall -pedantic -mtune=generic -fsanitize=address -Wno-deprecated-declarations -O2 -Wall -gdwarf-2 -mfpmath=sse -msse2 -mstackrealign -c int_to_tree.cpp -o int_to_tree.o
"path/to/llvm/bin/clang++" -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I'C:/Users/ms609/Documents/R/win-library/4.0/Rcpp/include' -Og -Wall -pedantic -mtune=generic -fsanitize=address -Wno-deprecated-declarations -O2 -Wall -gdwarf-2 -mfpmath=sse -msse2 -mstackrealign -c phangorn_bip.cpp -o phangorn_bip.o
"path/to/llvm/bin/clang++" -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I'C:/Users/ms609/Documents/R/win-library/4.0/Rcpp/include' -Og -Wall -pedantic -mtune=generic -fsanitize=address -Wno-deprecated-declarations -O2 -Wall -gdwarf-2 -mfpmath=sse -msse2 -mstackrealign -c renumber_tree.cpp -o renumber_tree.o
"path/to/llvm/bin/clang++" -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I'C:/Users/ms609/Documents/R/win-library/4.0/Rcpp/include' -Og -Wall -pedantic -mtune=generic -fsanitize=address -Wno-deprecated-declarations -O2 -Wall -gdwarf-2 -mfpmath=sse -msse2 -mstackrealign -c splits.cpp -o splits.o
"path/to/llvm/bin/clang++" -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I'C:/Users/ms609/Documents/R/win-library/4.0/Rcpp/include' -Og -Wall -pedantic -mtune=generic -fsanitize=address -Wno-deprecated-declarations -O2 -Wall -gdwarf-2 -mfpmath=sse -msse2 -mstackrealign -c tree_shape.cpp -o tree_shape.o
path/to/llvm/bin/clang++ -shared -o TreeTools.dll tmp.def RcppExports.o TreeTools-init.o as_newick.o int_to_tree.o phangorn_bip.o renumber_tree.o splits.o tree_shape.o -LC:/PROGRA~1/R/R-40~1.0/bin/i386 -lR
tmp.def : fatal error LNK1107: invalid or corrupt file: cannot read at 0x1E50
clang++: error: linker command failed with exit code 1107 (use -v to see invocation)
no DLL was created
ERROR: compilation failed for package 'TreeTools'
R seems to have successfully compiled individual source files successfully using clang, but is failing to create a .dll.
What have I missed: do I need to do anything to configure Rcmd or Rtools to run with clang rather than the default gcc?

Code base not finding standard C++ library header

I am compiling an example application from the SDK repository of a third party vendor. I receive an error that one of the C++ header's (algorithm) cannot be found:
if [ ! -d .deps/ ]; then mkdir -p .deps/; fi
/opt/llvm-3.8.0/bin/clang++ -M -isystem/opt/tbricks/sdk/include64 -I../../.. -I../../../.. -I./../../../.. -DLINUX -DLINUX64 -DTB_USE_RCU -DURCU_INLINE_SMALL_FUNCTIONS -DU_USING_ICU_NAMESPACE=0 -DNDEBUG -D_POSIX_PTHREAD_SEMANTICS -fPIC -D_GNU_SOURCE -DTB_USE_RCU -DTB_USE_RCU -D_GLIBCXX_USE_CXX11_ABI=0 -m64 --gcc-toolchain=/opt/gcc-5.2.0 -flto=full -std=gnu++14 -D_GLIBCXX_DEPRECATED= -pipe -fno-omit-frame-pointer -ffast-math -fno-finite-math-only -pthread -march=core2 -mtune=corei7 -g -O3 -Qunused-arguments -fnon-call-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wshadow -Wpointer-arith -Wno-self-assign -Wno-unused-function -Wno-gnu-empty-initializer -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-mismatched-tags -Wno-unused-local-typedef -Wno-parentheses-equality -Wno-unused-private-field -Wno-missing-field-initializers -Wno-missing-braces -Werror=return-type -Werror=overloaded-virtual -DSTRATEGY_BUILD_PROFILE=\"release\" ../../../../shared/Helpers.cpp > .deps/Helpers.o.d
../../../../shared/Helpers.cpp:14:10: fatal error: 'algorithm' file not found
#include <algorithm>
What sets the location path to search for C++ header files, such as algorithm? Is there anything I can grep for within makefiles?
Either install g++ alongside (you need libstdc++) or use LLVM libc++ and specify it with -stdlib=libc++

Why might make produce a different object file than the same command copy-pasted and entered manually?

Sort of related to my other question here, since this is also about building llvm.
When trying to get around a build failure in llvm, I noticed the following:
Output in terminal when building a single object file through make:
rp% make asan_posix.o
cd /tmp/llvm20150917-93899-y384cu && /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make -f projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.iossim.dir/build.make projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o
Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o
cd /tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan && /usr/local/Library/ENV/4.3/clang++ -DASAN_DYNAMIC=1 -DASAN_HAS_EXCEPTIONS=1 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-y384cu/include -I/tmp/llvm20150917-93899-1jg6jdx/include -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/.. -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -arch i386 -arch x86_64 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -stdlib=libc++ -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-function-sections -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -ftls-model=initial-exec -o CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o -c /tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/asan_posix.cc
cd /tmp/llvm20150917-93899-y384cu && /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make -f projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.osx.dir/build.make projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o
Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o
cd /tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan && /usr/local/Library/ENV/4.3/clang++ -DASAN_DYNAMIC=1 -DASAN_HAS_EXCEPTIONS=1 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-y384cu/include -I/tmp/llvm20150917-93899-1jg6jdx/include -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/.. -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -arch i386 -arch x86_64 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.9 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-function-sections -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -ftls-model=initial-exec -o CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o -c /tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/asan_posix.cc
rp% file CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o
CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o: Mach-O 64-bit object x86_64
rp% file CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o
CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o: Mach-O 64-bit object x86_64
Output when the same commands are entered manually:
rp% cd /tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan && /usr/local/Library/ENV/4.3/clang++ -DASAN_DYNAMIC=1 -DASAN_HAS_EXCEPTIONS=1 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-y384cu/include -I/tmp/llvm20150917-93899-1jg6jdx/include -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/.. -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -arch i386 -arch x86_64 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -stdlib=libc++ -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-function-sections -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -ftls-model=initial-exec -o CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o -c /tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/asan_posix.cc
rp% cd /tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan && /usr/local/Library/ENV/4.3/clang++ -DASAN_DYNAMIC=1 -DASAN_HAS_EXCEPTIONS=1 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm20150917-93899-y384cu/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan -I/tmp/llvm20150917-93899-y384cu/include -I/tmp/llvm20150917-93899-1jg6jdx/include -I/tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/.. -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -arch i386 -arch x86_64 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -Wall -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.9 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-function-sections -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -ftls-model=initial-exec -o CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o -c /tmp/llvm20150917-93899-1jg6jdx/projects/compiler-rt/lib/asan/asan_posix.cc
rp% file CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o
CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o: Mach-O universal binary with 2 architectures
CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o (for architecture i386): Mach-O object i386
CMakeFiles/RTAsan_dynamic.iossim.dir/asan_posix.cc.o (for architecture x86_64): Mach-O 64-bit object x86_64
rp% file CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o
CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o: Mach-O universal binary with 2 architectures
CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o (for architecture i386): Mach-O object i386
CMakeFiles/RTAsan_dynamic.osx.dir/asan_posix.cc.o (for architecture x86_64): Mach-O 64-bit object x86_64
The searching I did didn't really help; I didn't write the makefile myself (cmake generated), and at least to my eyes there wasn't reason for make to print something that it wasn't executing.
Anyone have any idea what is going on?
Reproduction steps:
install homebrew if it isn't already installed
replace homebrew's llvm formula with the WIP one here
Run brew install llvm --with-clang --with-lldb --verbose --debug
wait for the build to fail and ask you what to do
Drop into a debug shell
cd to projects/compiler-rt/lib/asan
run make clean
run make asan_posix.o (or any of the other *.o files listed in make help
run file on the output file (in CMakeFiles/RTAsan_dynamic.(osx|iossim).dir/asan_posix.cc.o for me)
Repeat the above 3 steps, but copy-pasting the command instead of running make
Edit: Link to my environment in the shell and during the make process.
The solution to this question ended up being the same as the linked question. homebrew was changing compiler flags, so the commands that were printed weren't the ones being executed. The fix in the other question also happened to fix this.

Expression is not an integer constant expression

I am using xcode 4.2.1, Apple LLVM compiler 3.0.
Project cleans successfully in xcode and builds successfully from the command line. The problem is the project fails to build in xcode. I feel like I am missing something in my xcode configuration. I have made no edits to the original source I pulled down.
From the log navigator:
CompileC /Developer/Code/blender-build/cmake/source/blender/blenkernel/Blender.build/Debug/bf_blenkernel.build/Objects-normal/x86_64/idcode.o source/blender/blenkernel/intern/idcode.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
cd /Developer/Code/blender-build/blender
setenv LANG en_US.US-ASCII
/Developer/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -O0 -Wno-return-type -Wparentheses -Wswitch -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-shorten-64-to-32 "-DCMAKE_INTDIR=\"Debug\"" -DHAVE_STDBOOL_H -D__SSE__ -D__MMX__ -D__SSE2__ -D__LITTLE_ENDIAN__ -DOPJ_STATIC -DGLEW_STATIC -DWITH_AUDASPACE -DWITH_BULLET -DWITH_OPENEXR -DWITH_TIFF -DWITH_OPENJPEG -DWITH_DDS -DWITH_CINEON -DWITH_FRAMESERVER -DWITH_HDR -DWITH_AVI -DWITH_QUICKTIME -DWITH_PYTHON -DWITH_PYTHON_SECURITY -DWITH_MOD_FLUID -DWITH_SMOKE -DWITH_LZO -DWITH_LZMA -DWITH_GAMEENGINE -DWITH_LIBMV -DFFTW3=1 -DWITH_INTERNATIONAL -DWITH_FREESTYLE -DDEBUG -D_DEBUG -isysroot /Developer/SDKs/MacOSX10.7.sdk -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -Wno-sign-conversion -I/Developer/Code/blender-build/cmake/lib/Debug/include -I/Developer/Code/blender-build/blender/source/blender/blenkernel -I/Developer/Code/blender-build/blender/source/blender/blenfont -I/Developer/Code/blender-build/blender/source/blender/blenlib -I/Developer/Code/blender-build/blender/source/blender/blenloader -I/Developer/Code/blender-build/blender/source/blender/gpu -I/Developer/Code/blender-build/blender/source/blender/ikplugin -I/Developer/Code/blender-build/blender/source/blender/imbuf -I/Developer/Code/blender-build/blender/source/blender/makesdna -I/Developer/Code/blender-build/blender/source/blender/makesrna -I/Developer/Code/blender-build/blender/source/blender/bmesh -I/Developer/Code/blender-build/blender/source/blender/modifiers -I/Developer/Code/blender-build/blender/source/blender/nodes -I/Developer/Code/blender-build/blender/source/blender/render/extern/include -I/Developer/Code/blender-build/blender/intern/guardedalloc -I/Developer/Code/blender-build/blender/intern/iksolver/extern -I/Developer/Code/blender-build/blender/intern/memutil -I/Developer/Code/blender-build/blender/intern/mikktspace -I/Developer/Code/blender-build/blender/intern/raskter -I/Developer/Code/blender-build/blender/intern/smoke/extern -I/Developer/Code/blender-build/blender/extern/libmv -I/Developer/Code/blender-build/blender/intern/atomic -I/Developer/Code/blender-build/blender/source/blender/windowmanager -I/Developer/Code/blender-build/blender/intern/audaspace/intern -I/Developer/Code/blender-build/blender/intern/rigidbody -I/Developer/Code/blender-build/blender/source/blender/avi -I/Developer/Code/blender-build/blender/source/blender/quicktime -I/Developer/Code/blender-build/blender/source/blender/python -I/Developer/Code/blender-build/blender/intern/elbeem/extern -I/Developer/Code/blender-build/blender/extern/glew/include -I/Developer/Code/blender-build/blender/extern/bullet2/src -I/Developer/Code/blender-build/blender/extern/lzo/minilzo -I/Developer/Code/blender-build/blender/extern/lzma -I/Developer/Code/blender-build/blender/extern/recastnavigation -I/Developer/Code/blender-build/lib/darwin-9.x.universal/fftw3/include -I/Developer/Code/blender-build/cmake/source/blender/blenkernel/Blender.build/Debug/bf_blenkernel.build/DerivedSources/x86_64 -I/Developer/Code/blender-build/cmake/source/blender/blenkernel/Blender.build/Debug/bf_blenkernel.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Developer/Code/blender-build/cmake/lib/Debug -F/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks -Wall -Wcast-align -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=return-type -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Winit-self -Wnonnull -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -msse2 -msse -pipe -funsigned-char -fno-strict-aliasing -MMD -MT dependencies -MF /Developer/Code/blender-build/cmake/source/blender/blenkernel/Blender.build/Debug/bf_blenkernel.build/Objects-normal/x86_64/idcode.d -c /Developer/Code/blender-build/blender/source/blender/blenkernel/intern/idcode.c -o /Developer/Code/blender-build/cmake/source/blender/blenkernel/Blender.build/Debug/bf_blenkernel.build/Objects-normal/x86_64/idcode.o
Error:
/Developer/Code/blender-build/blender/source/blender/blenkernel/intern/idcode.c:90:10:{90:10-90:29}: error: expression is not an integer constant expression [3]
int i = ARRAY_SIZE(idtypes);
^~~~~~~~~~~~~~~~~~~
/Developer/Code/blender-build/blender/source/blender/blenlib/BLI_utildefines.h:353:36: note: instantiated from:
((sizeof(struct {int isnt_array : ((void *)&(arr) == &(arr)[0]);}) * 0) + \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What can I do to get a clean build?
I upgraded xcode to version 4.6.3. The compiler updated to LLVM 4.2 and these problems were resolved. Otherwise I don't know why the previous version was failing.