我正在尝试让 premake4 helloworld c++ 工作,但是在使用 premake 创建 makefile 后使用 release config 调用 make 时出错。(我在 osx 10.9.4 上使用 clang)调用make config=release
产生:
ld: internal error: atom not found in symbolIndex(...
如果我将“符号”标志添加到发布标志,一切正常。但这当然会创建调试符号。
premake4.lua:
solution "cpp_hello_world"
configurations { "Debug", "Release"}
project "cpp_hello_world.out"
kind "ConsoleApp"
language "C++"
files { "**.cpp" }
buildoptions { "-std=c++1y" }
configuration "Debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "Release"
defines { "NDEBUG" }
flags { "Optimize" }
主.cpp:
#include <iostream>
int main(){
std::cout << "hello world" << std::endl;
return 0;
}
知道为什么它不像标准示例中那样工作吗? http://industriousone.com/post/typical-c-project-0
使用完成输出make config=release verbose=1
:
==== Building cpp_hello_world.out (release) ====
Creating obj/Release
mkdir -p obj/Release
main.cpp
c++ -MMD -MP -DNDEBUG -O2 -std=c++1y -o "obj/Release/main.o" -c "main.cpp"
Linking cpp_hello_world.out
c++ -o ./cpp_hello_world.out obj/Release/main.o -Wl,-x
ld: internal error: atom not found in symbolIndex(__ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cpp_hello_world.out] Error 1
make: *** [cpp_hello_world.out] Error 2