解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题
环境工具: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 问题的更多相关文章
- 调用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 解决: ... 
- 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 ... 
- 用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 ... 
- ubuntu 编译C++ error: ‘syscall’ was not declared in this scope
		明明已经加了头文件 #include <sys/syscall.h> #include <sched.h> #include <sys/resource.h> 编译 ... 
- ffmpeg: ‘UINT64_C’ was not declared in this scope (转)
		ffmpeg 默认是用C文件来编译的,如果某个CPP文件想引用ffmpeg中的某些函数或者头文件,有可能出现 ‘UINT64_C’ was not declared in this scope的错误 ... 
- error: 'LOGE' was not declared in this scope
		移植了下HAL,发现编译出现如下错误 error: 'LOGE' was not declared in this scope 比较了一下android4.1的 system/core/include ... 
- 编译是报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 ... 
- [Error] 'exit' was not declared in this scope的解决方法
		新手刚开始用Linux和c++写程序,可能会出现下面的错误 error: ‘exit’ was not declared in this scope 解决方法是 添加 #include <cst ... 
- error: ‘errno’ was not declared in this scope
		问题: 将一个c文件改为cpp文件,其中的perror()改用C++中的std::cerr << strerror(error) << std::endl;来替换. 重新编译文 ... 
随机推荐
- Red Hat Linux 挂载外部资源
			在我们安装的Red Hat Linux 中.当中一半机器为最主要的server配置,没有桌面环境.在从U盘上复制文件的时候可就犯难了.在网上查了查才知道.要訪问U盘就必须先将它们挂载到Linux系统的 ... 
- PHP 回调函数call_user_func和 call_user_func_array()的理解
			call_user_func(function,param); // 第一个参数是回调函数的函数名,第二个参数是参数 call_user_func函数类似于一种特别的调用函数的方法.其主要有以下的类型 ... 
- Linux的信号解释
			转自:http://blog.csdn.net/yusiguyuan/article/details/43272225 整理后: 信号signal unix系统中,用信号实现软件中断 子进程结束-&g ... 
- linux中服务环境的搭建
			一.Samba服务 samba服务的安装及配置: sudo apt-get install samba 二.配置: 1.创建一个需要共享的目录,并修改权限: lpf@ubuntu:~$ mkdir l ... 
- This assembly may have been downloaded from the Web. ......
			错误消息例如: Error 6 Could not load the assembly file:///D:\me\Projects\DLL\Newtonsoft.Json\Portable40\Ne ... 
- 8-[表操作]--foreign key、表与表的关系
			1. foreign key (1)快速理解foreign key 员工信息表有三个字段:工号 姓名 部门 公司有3个部门,但是有1个亿的员工,那意味着部门这个字段需要重复存储,部门名字越长,越浪费 ... 
- 03 - django简介
			1.MVC与MTV模型 2.Django的下载与基本命令 pip install django==2.0.1 第三方库安装到哪里了? 创建一个django project C:\Desktop\fir ... 
- 5 行 Python 代码调用电脑摄像头
			前提: 确保 python 中安装了 opencv-python 模块.如果没有安装,可以参考:https://pypi.org/project/opencv-python/ 进行安装.话不多少,直接 ... 
- 设计模式之module模式及其改进
			写在前面 编写易于维护的代码,其中最重要的方面就是能够找到代码中重复出现的主题并优化他们,这也是设计模式最有价值的地方 <head first设计模式>里有一篇文章,是说使用模式的心智, ... 
- PS入门到精通完全自学教程
			ps视频教程,ps自学视频教程.ps免费视频教程下载,PS入门到精通完全自学教程视频内容较大,分为俩部分: PS入门到精通完全自学教程-第一部分(带swf播放器):百度网盘,https://pan.b ... 
