Closed p3k closed 9 years ago
Hmm. Did you recently update to 10.10? And did you update your ports when you did? I googled for "couldn't understand kern.osversion `14.1.0'" and turned up a couple of links that seem to indicate that you might be using the gcc installation from before your upgrade.
Also, could you post the output of g++ -v
?
Compiled on Yosemite 10.10.2 (without MacPorts) without problems.
Output of g++ -v
:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
Thanks for the swift replies!
Are my Xcode command-line tools b0rked in some way?
$ gcc -v
couldn't understand kern.osversion `14.1.0'
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Anyway, after switching to the MacPort version of gcc everything built smoothly.
$ sudo port select gcc mp-gcc48
Selecting 'mp-gcc48' for 'gcc' succeeded. 'mp-gcc48' is now active.
$ make
g++ -g -O0 -c src/CodeGen_Bash.cpp -o obj/CodeGen_Bash.o -MMD -MF obj/CodeGen_Bash.d -MT obj/CodeGen_Bash.o -DSTDLIB_PATH="\"/Users/tobi/.bish/src/StdLib.bish\""
g++ -g -O0 -c src/Parser.cpp -o obj/Parser.o -MMD -MF obj/Parser.d -MT obj/Parser.o -DSTDLIB_PATH="\"/Users/tobi/.bish/src/StdLib.bish\""
g++ -g -O0 -c src/SymbolTable.cpp -o obj/SymbolTable.o -MMD -MF obj/SymbolTable.d -MT obj/SymbolTable.o -DSTDLIB_PATH="\"/Users/tobi/.bish/src/StdLib.bish\""
g++ -g -O0 -c src/TypeChecker.cpp -o obj/TypeChecker.o -MMD -MF obj/TypeChecker.d -MT obj/TypeChecker.o -DSTDLIB_PATH="\"/Users/tobi/.bish/src/StdLib.bish\""
g++ -g -O0 -c src/Util.cpp -o obj/Util.o -MMD -MF obj/Util.d -MT obj/Util.o -DSTDLIB_PATH="\"/Users/tobi/.bish/src/StdLib.bish\""
ld -r -o obj/bish.o obj/CallGraph.o obj/Compile.o obj/FindCalls.o obj/IR.o obj/IRVisitor.o obj/IRAncestorsPass.o obj/CodeGen_Bash.o obj/Parser.o obj/SymbolTable.o obj/TypeChecker.o obj/Util.o
ar q obj/libbish.a obj/bish.o
ar: creating archive obj/libbish.a
ranlib obj/libbish.a
g++ -g -O0 -o bish src/bish.cpp obj/libbish.a -DSTDLIB_PATH="\"/Users/tobi/.bish/src/StdLib.bish\""
OK, I think I found my mistake (or rather: relic of ancient times). I have had /Developer/usr/bin
in my PATH and there exist a lot of old binaries – among them the 4.2.1 version of gcc shown above.
After removal I now get the output as @victorgama :)
Glad you got it sorted out!
I am not sure if I am having the C++ Stdlib – how could I verify it? And how would I install it if necessary? I am using MacPorts.
Anyway, here is the compiler output: