【问题标题】:Errors while compiling irrlicht - android port (Mac OSX)编译 irrlicht 时出错 - android 端口 (Mac OSX)
【发布时间】:2013-11-22 05:43:55
【问题描述】:

我从这里下载了 irrlicht android:

https://gitorious.org/irrlichtandroid/irrlichtandroid/source/f12c3b9743d64dc5cd61931f40e42e8ca64b40ef:

我尝试使用 ndk-build 编译 irllicht android,我收到以下错误:

 In static member function 'static void irr::os::Printer::log(const c8*, irr::ELOG_LEVEL)':
error: format not a string literal and no format arguments [-Werror=format-security]
In static member function 'static void irr::os::Printer::log(wchar_t const*, irr::ELOG_LEVEL)':
 error: format not a string literal and no format arguments [-Werror=format-security]
In static member function 'static void irr::os::Printer::log(const c8*, const c8*, irr::ELOG_LEVEL)':
error: format not a string literal and no format arguments [-Werror=format-security]
In static member function 'static void irr::os::Printer::log(const c8*, const path&, irr::ELOG_LEVEL)':
error: format not a string literal and no format arguments [-Werror=format-security]
make: *** [obj/local/armeabi/objs/irrlicht/os.o] Error 1

有谁知道如何解决这个问题?任何帮助将不胜感激。

【问题讨论】:

    标签: android macos android-ndk irrlicht ndk-build


    【解决方案1】:

    找到问题的解决方案,在 project/default.propeties 中,我已更改:

    target=android-4
    

    target=android-18
    

    并且在 include/IrrCompileConfig.h 我已经注释掉了:

    //#define _IRR_COMPILE_WITH_OGLES1_
    

    因为我只需要 OpenGL ES 2。这解决了问题,irrlichtandroid 使用在我的项目 libs 文件夹中生成的 ndk-buildlibirrlicht.so 文件成功编译。

    【讨论】:

      【解决方案2】:

      在 os.cpp(在 /jni 目录内),将代码更改为:

       __android_log_print(ANDROID_LOG_INFO, "log", message);
      

      到:

       __android_log_print(ANDROID_LOG_INFO, "log","%s", message);
      

      解决了这个问题,但仍然出现错误:

      In file included from jni/importgl.cpp:55:0:
      jni/importgl.h:37:22: fatal error: GLES/egl.h: No such file or directory
      

      正在努力。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-02-17
        • 1970-01-01
        • 1970-01-01
        • 2013-05-04
        • 1970-01-01
        • 1970-01-01
        • 2017-06-09
        • 2012-08-07
        相关资源
        最近更新 更多