我试图让一个premake4 helloworld c++正常工作,但在使用premake创建makefile之后,通过释放配置调用make时出现错误。(我在OSX10.9.4上使用clang )调用make config=release会产生:
ld: internal error: atom not found in symbolIndex(...如果我将"Symbols“标志添加到发布标志中,一切都会正常工作。但这当然会创建调试符号。
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" }main.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发布于 2015-04-06 23:56:16
我可以使用Premake4在我的MacOSX10.10.2上重现这个错误。问题出在您的项目名称上,它不应该有.out扩展名。尝试在premake4.lua文件中将项目重命名为"cpp_hello_world“。
即,第4行应为:
project "cpp_hello_world"如果您在进行此更改后仍然遇到问题,我可以在10.9.4上的虚拟机上进行测试和故障排除-请让我知道!
https://stackoverflow.com/questions/24979986
复制相似问题