Window代码向Linux平台移植问题汇总
1、问题: __int64 was not declared in this scope
解决方案:
亲自测试将__int64 替换成 int64_t 比较好,如果换成long long 编译可能还存在问题
2、问题: strlen was not declared in this scope
解决方案:
主要原因是windows开发偷懒,只写了一个#include <string>
所以最终直接增加两个头文件即可
#include <cstring> // C++ 标准头文件,推荐使用
#include <string.h> // C 风格头文件
这种可以解决各种字符串比较等相关问题,如:
strcpy was not declared in this scope
strcmp was not declared in this scope
3、问题: _access was not declared in this scope
解决方案:
注意:头文件要更换,函数名也要更换
4、问题:_mkdir was not declared in this scope _rmdir was not declared in this scope
解决方案:
注意:头文件要更改,函数名要更改,在使用mkdir命令的时候Linux平台还要增加权限参数
5、问题:_strupr was not declared in this scope
解决方案:
6、问题:_itoa was not declared in this scope
解决方案:
持续更新