环境工具:Win10、VS2013、cocos2d-x-2.2.6、Cygwin、ADT

问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2dx lib库以后,讨厌的红x消失,下来就是在cygwin里面预编译得到xxx.so文件了,但是问题来了,报错!!!

jni/../../Classes/GameLayer.cpp:227:46: error: 'UINT64_C' was not declared in this scope

怎么解决呢?

看了一下'UINT64_C'的定义文件 stdint.h 路径显示是vs自带的,好像有点复杂了

那'UINT64_C'是什么呢?

经过查资料,简单的说,是一种数据类型,编译的时候默认是C文件来编译的,但是我用的是C++,错误便出现了。

既然是在打包apk的路上出的错,问题差不多就得往这方面考虑解决,于是查资料了解到

LOCAL_CFLAGS变量为C/C++编译器定义额外的标志,当编译C/C++源文件时传递一个可选的编译器标志,这对于指定额外的宏定义或编译选项很有用。

解决方案:

在Android.mk文件里添加:

LOCAL_CFLAGS := -D__STDC_CONSTANT_MACROS

问题得以解决。

解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题的更多相关文章

  1. 调用ffmpeg库编译时出现common.h:175:47: error: 'UINT64_C' was not declared in this scope

    解决办法 出现错误:jni/ffmpeg/libavutil/common.h:175:47: error: 'UINT64_C' was not declared in this scope 解决: ...

  2. In function 'int av_clipl_int32_c(int64_t)': error: 'UINT64_C' was not declared in this scope

    cygwin下使用ndk编译jni时遇到的错误: /ffmpeg/include/libavutil/common.h: In function 'int av_clipl_int32_c(int64 ...

  3. 用g++ 编译 ffmpeg 编译出现 error: 'UINT64_C' was not declared in this scope 或 missing -D__STDC_CONSTANT_MACROS

    在 libavutil/common.h 下 添加如下,即可解决 #ifdef __cplusplus#define __STDC_CONSTANT_MACROS#ifdef _STDINT_H#un ...

  4. ubuntu 编译C++ error: ‘syscall’ was not declared in this scope

    明明已经加了头文件 #include <sys/syscall.h> #include <sched.h> #include <sys/resource.h> 编译 ...

  5. ffmpeg: ‘UINT64_C’ was not declared in this scope (转)

    ffmpeg 默认是用C文件来编译的,如果某个CPP文件想引用ffmpeg中的某些函数或者头文件,有可能出现 ‘UINT64_C’ was not declared in this scope的错误 ...

  6. error: 'LOGE' was not declared in this scope

    移植了下HAL,发现编译出现如下错误 error: 'LOGE' was not declared in this scope 比较了一下android4.1的 system/core/include ...

  7. 编译是报error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope

    Compile++ thumb  : game_shared <= main.cpp jni/hellocpp/main.cpp: In function 'void Java_org_coco ...

  8. [Error] 'exit' was not declared in this scope的解决方法

    新手刚开始用Linux和c++写程序,可能会出现下面的错误 error: ‘exit’ was not declared in this scope 解决方法是 添加 #include <cst ...

  9. error: ‘errno’ was not declared in this scope

    问题: 将一个c文件改为cpp文件,其中的perror()改用C++中的std::cerr << strerror(error) << std::endl;来替换. 重新编译文 ...

随机推荐

  1. 【Git】Git Bash

    版本控制工具Git Bash软件 安装 git.exe  即可

  2. 深入理解PHP 数组之count 函数

    count()PHP count() 函数用于计算数组中的单元数目或对象中的属性个数,返回数组的单元个数或对象中的属性个数.语法:int count( mixed var [, int mode] ) ...

  3. 针对于网络安全领域中基于PCAP流量的数据集

    网络安全领域中基于PCAP流量的数据集 MAWI Working Group Traffic Archive URL:http://mawi.wide.ad.jp/mawi/ CIC dataset ...

  4. Verilog 奇数分频

    代码: module odd_div( ); ; //分频系数,3即3分频 ; reg clk, rstn, clk_div_pos, clk_div_neg; wire clk_div_out; : ...

  5. IPC学习

    课下作业-IPC 要求: 研究Linux下IPC机制:原理,优缺点,每种机制至少给一个示例,提交研究博客的链接 共享内存 管道 FIFO 信号 消息队列 共享内存 共享内存可以说是最有用的进程间通信方 ...

  6. mysql java 类型对照 int

    Java MySQL数据类型对照 类型名称 显示长度 数据库类型 JAVA类型 JDBC类型索引(int) 描述             VARCHAR L+N VARCHAR java.lang.S ...

  7. redis集群搭建+lua脚本的使用

    详细参考这篇文章(windows) https://blog.csdn.net/qiuyufeng/article/details/70474001 一.使用JAVA代码操作redis集群 publi ...

  8. Oracle单节点_Grid_Infrastructure_DB_安装过程图解(二/三)

    接上文 Oracle单节点_Grid_Infrastructure_DB_安装过程图解(一/三) 接下来,进行Grid Infrastructure 部分的安装:

  9. PostgreSQL的Checkpoint 发生的时机

    磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面:PostgreSQL基础知识与基本操作索引页    回到顶级页面:PostgreSQL索引页 官方说明来自: http://www.postg ...

  10. spark-client 一直 accepted,无法提交任务,报错Failed to connect to driver at

    这个问题的原因有几个: 1.客户端安装的机器一般是虚拟机,虚拟机的名称可能是随便搞的,然而,yarn-client模式提交任务,是默认把本机当成driver的.所以导致其他的机器无法通过host的na ...