编译过程参考:Win10环境下 编译 和 运行 x264_x.264下载使用教程-CSDN博客
一、gcc not found
在https://www.msys2.org/ 下载Mingw后,安装
pacman -S mingw-w64-x86_64-gcc
安装完成后,执行gcc -v提示找不到gcc
解决办法:
pacman -S mingw-w64-ucrt-x86_64-gcc
二、Found no assembler
编译时, --disable-asm
三、找不到类型
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(128,13): error C2143: 语法错误: 缺少“;”(在“*”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(128,13): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(128,23): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(314,17): error C3646: “cpu”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(314,20): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(385,17): error C3646: “cqm_4iy”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(385,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(385,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(386,17): error C3646: “cqm_4py”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(386,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(386,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(387,17): error C3646: “cqm_4ic”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(387,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(387,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(388,17): error C3646: “cqm_4pc”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(388,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(388,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(389,17): error C3646: “cqm_8iy”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(389,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(389,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(390,17): error C3646: “cqm_8py”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(390,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(390,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(391,17): error C3646: “cqm_8ic”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(391,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(391,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(392,17): error C3646: “cqm_8pc”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(392,24): error C2143: 语法错误: 缺少“,”(在“[”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(392,28): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(508,17): error C3646: “i_display_max”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(508,30): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(509,17): error C3646: “i_display_min”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(509,30): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(532,14): error C3646: “i_fps_num”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(532,23): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(533,14): error C3646: “i_fps_den”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(533,23): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(534,14): error C3646: “i_timebase_num”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(534,28): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(535,14): error C3646: “i_timebase_den”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(535,28): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(623,43): error C2061: 语法错误: 标识符“uint8_t”
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(631,14): error C3646: “level_idc”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(631,23): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(632,14): error C3646: “mbps”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(632,18): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(633,14): error C3646: “frame_size”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(633,24): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(634,14): error C3646: “dpb”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(634,17): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(635,14): error C3646: “bitrate”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(635,21): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(636,14): error C3646: “cpb”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(636,17): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(637,14): error C3646: “mv_range”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(637,22): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(638,14): error C3646: “mvs_per_2mb”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(638,25): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(639,14): error C3646: “slice_rate”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(639,24): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(640,14): error C3646: “mincr”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(640,19): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(641,14): error C3646: “bipred8x8”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(641,23): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(642,14): error C3646: “direct8x8”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(642,23): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(643,14): error C3646: “frame_only”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(643,24): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(788,13): error C2143: 语法错误: 缺少“;”(在“*”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(788,13): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(788,21): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(804,13): error C2143: 语法错误: 缺少“;”(在“*”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(804,13): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(804,22): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(844,13): error C2143: 语法错误: 缺少“;”(在“*”的前面)
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(844,13): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(844,21): error C2238: 意外的标记位于“;”之前
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(880,13): error C3646: “i_pts”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(880,18): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(883,13): error C3646: “i_dts”: 未知重写说明符
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(883,18): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>(编译源文件“ManageX264.cpp”)
1>D:\Demo\ScreenShare_Server\x264\include\x264.h(1020,59): error C2061: 语法错误: 标识符“int64_t”
如图:
解决办法, 新增头文件:
include <cstdint>