2

premake4 の helloworld c++ を動作させようとしていますが、premake で makefile を作成した後にリリース構成で make を呼び出すとエラーが発生します。(私はosx 10.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
4

1 に答える 1