0

我正在尝试从 John McCucatchan github [ 1 ] 编译 Bullet 演示,但没有成功。此存储库中的预制文件设置为仅构建 NaClAMBullet 和 NaClAMTest。所以我修改了 premake64.lua 以针对 NaClAMBullet 而不是 NaClAMTest。但它没有用。

local nacl_sdk_path = os.getenv("NACL_SDK_ROOT")
local nacl_toolchain_path = os.getenv("NACL_SDK_BIN")
local bullet_path = os.getenv("BULLET_ROOT")
premake.gcc.cc  = nacl_toolchain_path .. "/x86_64-nacl-gcc"
premake.gcc.cxx = nacl_toolchain_path .. "/x86_64-nacl-g++"
premake.gcc.ar  = nacl_toolchain_path .. "/x86_64-nacl-ar"

solution "NaClAM"
    configurations { "Debug", "Release" }

project "NaClAMBase64"
    kind "StaticLib"
    language "C++"
    files { 
        "NaClAMBase/*.cpp",
        }
    includedirs { nacl_sdk_path .. "/include" }
    configuration "Debug"
        defines { "DEBUG" }
        flags { "Symbols" }
        targetdir "premake/lib/debug"
        buildoptions { "-std=gnu++0x -fno-rtti -fno-exceptions -m64 -msse2" }
    configuration "Release"
        defines {"NDEBUG"}
        flags {"Optimize"}
        targetdir "premake/lib/release"
        buildoptions { "-std=gnu++0x -fno-rtti -fno-exceptions -m64 -msse2" }

project "NaClAMBullet64"
    kind "ConsoleApp"
    language "C++"
    files {
        "NaClAMBullet/*.cpp",
        }
    includedirs { "." }
    includedirs { bullet_path }
    includedirs { "/include" }
    includedirs { nacl_sdk_path .. "/include" }
    links { "NaClAMBase64", "m", "pthread", "ppapi" }
    configuration "Debug"
        defines { "DEBUG" }
        flags { "Symbols" }
        targetdir "premake/bin/debug"
        targetextension ".nexe"
        buildoptions { "-std=gnu++0x -fno-rtti -fno-exceptions -m64 -msse2" }
    configuration "Release"
        defines {"NDEBUG"}
        flags {"Optimize"}
        targetdir "premake/bin/release"
        targetextension ".nexe"
        buildoptions { "-std=gnu++0x -fno-rtti -fno-exceptions -m64 -msse2" }

要构建 Makefile,我只需运行以下行:

premake4 --file=premake64.lua gmake

要构建应用程序,只需键入:

make -R

这些操作的结果是以下编译错误:

==== Building NaClAMBullet64 (debug) ====
Creating obj/Debug/NaClAMBullet64
NaClAMBullet.cpp
NaClAMBullet/NaClAMBullet.cpp: In function ‘void handleStepScene(const NaClAMMessage&)’:
NaClAMBullet/NaClAMBullet.cpp:336:40: error: call of overloaded ‘Value(uint64_t&)’ is ambiguous
     root["simtime"] = Json::Value(delta);
                                        ^
NaClAMBullet/NaClAMBullet.cpp:336:40: note: candidates are:
In file included from ./NaClAMBase/NaClAMBase.h:18:0,
                 from NaClAMBullet/NaClAMBullet.cpp:4:
./NaClAMBase/json/json.h:559:7: note: Json::Value::Value(const Json::Value&)
       Value( const Value &other );
       ^
./NaClAMBase/json/json.h:558:7: note: Json::Value::Value(bool)
       Value( bool value );
       ^
./NaClAMBase/json/json.h:554:7: note: Json::Value::Value(const string&) <near match>
       Value( const std::string &value );
       ^
./NaClAMBase/json/json.h:554:7: note:   no known conversion for argument 1 from ‘uint64_t {aka long unsigned int}’ to ‘const string& {aka const std::basic_string<char>&}’
./NaClAMBase/json/json.h:541:7: note: Json::Value::Value(const char*) <near match>
       Value( const char *value );
       ^
./NaClAMBase/json/json.h:541:7: note:   no known conversion for argument 1 from ‘uint64_t {aka long unsigned int}’ to ‘const char*’
./NaClAMBase/json/json.h:540:7: note: Json::Value::Value(double)
       Value( double value );
       ^
./NaClAMBase/json/json.h:538:7: note: Json::Value::Value(Json::Value::UInt64)
       Value( UInt64 value );
       ^
./NaClAMBase/json/json.h:537:7: note: Json::Value::Value(Json::Value::Int64)
       Value( Int64 value );
       ^
./NaClAMBase/json/json.h:535:7: note: Json::Value::Value(Json::Value::UInt)
       Value( UInt value );
       ^
./NaClAMBase/json/json.h:534:7: note: Json::Value::Value(Json::Value::Int)
       Value( Int value );
       ^
./NaClAMBase/json/json.h:533:7: note: Json::Value::Value(Json::ValueType) <near match>
       Value( ValueType type = nullValue );
       ^
./NaClAMBase/json/json.h:533:7: note:   no known conversion for argument 1 from ‘uint64_t {aka long unsigned int}’ to ‘Json::ValueType’
NaClAMBullet64.make:129: recipe for target 'obj/Debug/NaClAMBullet64/NaClAMBullet.o' failed
make[1]: *** [obj/Debug/NaClAMBullet64/NaClAMBullet.o] Error 1
Makefile:20: recipe for target 'NaClAMBullet64' failed
make: *** [NaClAMBullet64] Error 2

我究竟做错了什么?这些依赖关系问题是否需要在 premake 文件或其他地方解决?

4

1 回答 1

1

如果认为这是一个与 Premake 无关的构建问题:编译器无法决定它应该使用哪个版本的 Json::Value 构造函数。

于 2015-09-11T15:32:45.073 回答