VS2019新建osgEarth项目时,GL.h文件提示报错
报错信息
使用VS2019创建空项目,添加osgearth_annotation.cpp文件,设置Windows SDK版本、附加包含文件目录、及输入库后,进行编译,出错信息如下:
1>------ 已启动生成: 项目: Project2, 配置: Release x64 ------
1>osgearth_annotation.cpp
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1158): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1158): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1158): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1159): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1159): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1159): error C2146: 语法错误: 缺少“;”(在标识符“GLboolean”的前面)
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1160): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1160): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1160): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1161): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1161): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1161): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1162): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1162): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1162): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1163): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1163): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1163): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1164): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1164): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1164): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1165): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1165): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1165): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1166): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1166): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1166): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1167): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1167): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1167): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1168): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1168): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1168): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1169): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1169): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1169): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1170): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1170): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1170): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1171): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1171): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1171): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1172): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1172): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1172): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1173): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1173): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1173): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1174): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1174): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1174): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1175): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1175): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1175): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1176): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1176): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1176): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1177): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1177): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1177): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1178): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1178): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1178): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1179): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1179): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1179): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1180): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1180): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1180): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1181): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1181): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1181): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1182): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1182): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1182): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1183): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1183): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1183): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1184): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1184): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1184): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1185): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1185): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1185): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1186): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1186): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1186): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1187): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1187): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1187): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1188): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1188): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1188): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1189): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1189): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1189): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1190): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1190): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1190): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1191): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1191): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1191): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1192): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1192): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1192): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1193): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1193): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1193): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1194): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1194): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1194): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1195): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1195): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1195): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1196): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1196): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1196): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1197): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1197): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1197): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1198): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1198): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1198): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1199): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1199): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1199): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1200): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1200): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1200): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1201): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1201): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1201): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1202): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1202): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1202): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1203): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1203): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1203): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1204): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1204): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1204): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1205): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1205): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1205): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1206): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1206): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1206): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1207): error C2144: 语法错误:“void”的前面应有“;”
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1207): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1207): error C2086: “int WINGDIAPI”: 重定义
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1157): note: 参见“WINGDIAPI”的声明
1>c:\program files (x86)\windows kits\10\include\10.0.19041.0\um\gl\gl.h(1207): fatal error C1003: 错误计数超过 100;正在停止编译
1>已完成生成项目“Project2.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
解决方法:
在osgearth_annotation.cpp的开始添加
#include<windows.h>
osgearth_annotation.cpp全部内容
/* -*-c++-*- */
/* osgEarth - Geospatial SDK for OpenSceneGraph
* Copyright 2018 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#include<windows.h>
#include <osgEarth/MapNode>
#include <osgEarthUtil/EarthManipulator>
#include <osgEarthUtil/ExampleResources>
#include <osgEarthAnnotation/ImageOverlay>
#include <osgEarthAnnotation/CircleNode>
#include <osgEarthAnnotation/RectangleNode>
#include <osgEarthAnnotation/EllipseNode>
#include <osgEarthAnnotation/PlaceNode>
#include <osgEarthAnnotation/LabelNode>
#include <osgEarthAnnotation/LocalGeometryNode>
#include <osgEarthAnnotation/FeatureNode>
#include <osgEarthAnnotation/ModelNode>
#include <osgEarthAnnotation/AnnotationEditing>
#include <osgEarthAnnotation/ImageOverlayEditor>
#include <osgEarthSymbology/GeometryFactory>
#include <osgViewer/Viewer>
using namespace osgEarth;
using namespace osgEarth::Annotation;
using namespace osgEarth::Features;
using namespace osgEarth::Util;
//------------------------------------------------------------------
int
usage( char** argv )
{
OE_WARN << "Usage: " << argv[0] << " <earthfile>" << std::endl;
return -1;
}
//------------------------------------------------------------------
int
main(int argc, char** argv)
{
osg::Group* root = new osg::Group();
// try to load an earth file.
osg::ArgumentParser arguments(&argc,argv);
osgViewer::Viewer viewer(arguments);
viewer.setCameraManipulator( new EarthManipulator() );
// load an earth file and parse demo arguments
osg::Node* node = MapNodeHelper().load(arguments, &viewer);
if ( !node )
return usage(argv);
root->addChild( node );
// find the map node that we loaded.
MapNode* mapNode = MapNode::findMapNode(node);
if ( !mapNode )
return usage(argv);
// Group to hold all our annotation elements.
osg::Group* annoGroup = new osg::Group();
MapNode::get(node)->addChild( annoGroup );
// Make a group for labels
osg::Group* labelGroup = new osg::Group();
annoGroup->addChild( labelGroup );
osg::Group* editGroup = new osg::Group();
MapNode::get(node)->addChild( editGroup );
// Style our labels:
Style labelStyle;
labelStyle.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_CENTER;
labelStyle.getOrCreate<TextSymbol>()->fill()->color() = Color::Yellow;
// A lat/long SRS for specifying points.
const SpatialReference* geoSRS = mapNode->getMapSRS()->getGeographicSRS();
//--------------------------------------------------------------------
// A series of place nodes (an icon with a text label)
{
Style pm;
pm.getOrCreate<IconSymbol>()->url()->setLiteral( "../data/placemark32.png" );
pm.getOrCreate<IconSymbol>()->declutter() = true;
pm.getOrCreate<TextSymbol>()->halo() = Color("#5f5f5f");
// bunch of pins:
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS, -74.00, 40.71), "New York" , pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS, -77.04, 38.85), "Washington, DC", pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS,-118.40, 33.93), "Los Angeles" , pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS, -71.03, 42.37), "Boston" , pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS,-157.93, 21.35), "Honolulu" , pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS, 139.75, 35.68), "Tokyo" , pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS, -90.25, 29.98), "New Orleans" , pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS, -80.28, 25.82), "Miami" , pm));
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS,-117.17, 32.72), "San Diego" , pm));
// test with an LOD:
osg::LOD* lod = new osg::LOD();
lod->addChild( new PlaceNode(GeoPoint(geoSRS, 14.68, 50.0), "Prague", pm), 0.0, 2e6);
labelGroup->addChild( lod );
// absolute altitude:
labelGroup->addChild( new PlaceNode(GeoPoint(geoSRS, -87.65, 41.90, 1000, ALTMODE_ABSOLUTE), "Chicago", pm));
}
//--------------------------------------------------------------------
// a box that follows lines of latitude (rhumb line interpolation, the default)
// and flashes on and off using a cull callback.
{
struct C : public osg::NodeCallback {
void operator()(osg::Node* n, osg::NodeVisitor* nv) {
static int i=0;
i++;
if (i % 100 < 50)
traverse(n, nv);
}
};
Geometry* geom = new osgEarth::Symbology::Polygon();
geom->push_back( osg::Vec3d(0, 40, 0) );
geom->push_back( osg::Vec3d(-60, 40, 0) );
geom->push_back( osg::Vec3d(-60, 60, 0) );
geom->push_back( osg::Vec3d(0, 60, 0) );
Feature* feature = new Feature(geom, geoSRS);
feature->geoInterp() = GEOINTERP_RHUMB_LINE;
Style geomStyle;
geomStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::Cyan;
geomStyle.getOrCreate<LineSymbol>()->stroke()->width() = 5.0f;
geomStyle.getOrCreate<LineSymbol>()->tessellationSize() = 75000;
geomStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
geomStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU;
FeatureNode* fnode = new FeatureNode(feature, geomStyle);
fnode->addCullCallback(new C());
annoGroup->addChild( fnode );
LabelNode* label = new LabelNode("Rhumb line polygon", labelStyle);
label->setPosition(GeoPoint(geoSRS, -30, 50));
labelGroup->addChild(label);
}
//--------------------------------------------------------------------
// another rhumb box that crosses the antimeridian
{
Geometry* geom = new osgEarth::Symbology::Polygon();
geom->push_back( -160., -30. );
geom->push_back( 150., -20. );
geom->push_back( 160., -45. );
geom->push_back( -150., -40. );
Style geomStyle;
Feature* feature = new Feature(geom, geoSRS);
feature->geoInterp() = GEOINTERP_RHUMB_LINE;
geomStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::Lime;
geomStyle.getOrCreate<LineSymbol>()->stroke()->width() = 3.0f;
geomStyle.getOrCreate<LineSymbol>()->tessellationSize() = 75000;
geomStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
geomStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU;
FeatureNode* gnode = new FeatureNode(feature, geomStyle);
annoGroup->addChild( gnode );
LabelNode* label = new LabelNode("Antimeridian polygon", labelStyle);
label->setPosition(GeoPoint(geoSRS, -175, -35));
labelGroup->addChild(label);
}
//--------------------------------------------------------------------
// A path using great-circle interpolation.
// Keep a pointer to it so we can modify it later on.
FeatureNode* pathNode = 0;
{
Geometry* path = new LineString();
path->push_back( osg::Vec3d(-74, 40.714, 0) ); // New York
path->push_back( osg::Vec3d(139.75, 35.68, 0) ); // Tokyo
Feature* pathFeature = new Feature(path, geoSRS);
pathFeature->geoInterp() = GEOINTERP_GREAT_CIRCLE;
Style pathStyle;
pathStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::White;
pathStyle.getOrCreate<LineSymbol>()->stroke()->width() = 1.0f;
pathStyle.getOrCreate<LineSymbol>()->stroke()->smooth() = true;
pathStyle.getOrCreate<LineSymbol>()->tessellationSize() = 75000;
pathStyle.getOrCreate<PointSymbol>()->size() = 8;
pathStyle.getOrCreate<PointSymbol>()->fill()->color() = Color::Red;
pathStyle.getOrCreate<PointSymbol>()->smooth() = true;
pathStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
pathStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU;
pathStyle.getOrCreate<RenderSymbol>()->depthOffset()->enabled() = true;
//OE_INFO << "Path extent = " << pathFeature->getExtent().toString() << std::endl;
pathNode = new FeatureNode(pathFeature, pathStyle);
annoGroup->addChild( pathNode );
LabelNode* label = new LabelNode("Great circle path", labelStyle);
label->setPosition(GeoPoint(geoSRS,-170, 61.2));
labelGroup->addChild(label);
}
//--------------------------------------------------------------------
// Two circle segments around New Orleans.
{
Style circleStyle;
circleStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Cyan, 0.5);
circleStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
circleStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;
CircleNode* circle = new CircleNode();
circle->set(
GeoPoint(geoSRS, -90.25, 29.98, 1000., ALTMODE_RELATIVE),
Distance(300, Units::KILOMETERS),
circleStyle,
Angle(-45.0, Units::DEGREES),
Angle(45.0, Units::DEGREES),
true);
annoGroup->addChild( circle );
editGroup->addChild( new CircleNodeEditor(circle) );
}
{
Style circleStyle;
circleStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Red, 0.5);
circleStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
circleStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;
CircleNode* circle = new CircleNode();
circle->set(
GeoPoint(geoSRS, -90.25, 29.98, 1000., ALTMODE_RELATIVE),
Distance(300, Units::KILOMETERS),
circleStyle,
Angle(45.0, Units::DEGREES),
Angle(360.0 - 45.0, Units::DEGREES),
true);
annoGroup->addChild( circle );
editGroup->addChild( new CircleNodeEditor(circle) );
}
//--------------------------------------------------------------------
// An extruded ellipse around Miami.
{
Style ellipseStyle;
ellipseStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Orange, 0.75);
ellipseStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
EllipseNode* ellipse = new EllipseNode();
ellipse->set(
GeoPoint(geoSRS, -80.28, 25.82, 0.0, ALTMODE_RELATIVE),
Distance(250, Units::MILES),
Distance(100, Units::MILES),
Angle (0, Units::DEGREES),
ellipseStyle,
Angle(45.0, Units::DEGREES),
Angle(360.0 - 45.0, Units::DEGREES),
true);
annoGroup->addChild( ellipse );
editGroup->addChild( new EllipseNodeEditor(ellipse) );
}
{
Style ellipseStyle;
ellipseStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Blue, 0.75);
ellipseStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
EllipseNode* ellipse = new EllipseNode();
ellipse->set(
GeoPoint(geoSRS, -80.28, 25.82, 0.0, ALTMODE_RELATIVE),
Distance(250, Units::MILES),
Distance(100, Units::MILES),
Angle (0, Units::DEGREES),
ellipseStyle,
Angle(-40.0, Units::DEGREES),
Angle(40.0, Units::DEGREES),
true);
annoGroup->addChild( ellipse );
editGroup->addChild( new EllipseNodeEditor(ellipse) );
}
//--------------------------------------------------------------------
{
// A rectangle around San Diego
Style rectStyle;
rectStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Green, 0.5);
rectStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
rectStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;
RectangleNode* rect = new RectangleNode(
GeoPoint(geoSRS, -117.172, 32.721),
Distance(300, Units::KILOMETERS ),
Distance(600, Units::KILOMETERS ),
rectStyle);
annoGroup->addChild( rect );
editGroup->addChild( new RectangleNodeEditor(rect) );
}
//--------------------------------------------------------------------
// An extruded polygon roughly the shape of Utah. Here we demonstrate the
// FeatureNode, where you create a geographic geometry and use it as an
// annotation.
{
Geometry* utah = new osgEarth::Symbology::Polygon();
utah->push_back( -114.052, 37.0 );
utah->push_back( -109.054, 37.0 );
utah->push_back( -109.054, 41.0 );
utah->push_back( -111.040, 41.0 );
utah->push_back( -111.080, 42.059 );
utah->push_back( -114.080, 42.024 );
Style utahStyle;
utahStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
utahStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::White, 0.8);
Feature* utahFeature = new Feature(utah, geoSRS);
FeatureNode* featureNode = new FeatureNode(utahFeature, utahStyle);
annoGroup->addChild( featureNode );
}
//--------------------------------------------------------------------
// an image overlay.
{
ImageOverlay* imageOverlay = 0L;
osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile( "../data/USFLAG.TGA" );
if (image.valid())
{
imageOverlay = new ImageOverlay(mapNode, image.get());
imageOverlay->setBounds( Bounds( -100.0, 35.0, -90.0, 40.0) );
annoGroup->addChild( imageOverlay );
editGroup->addChild( new ImageOverlayEditor(imageOverlay) );
}
}
//--------------------------------------------------------------------
// a model node with auto scaling.
{
Style style;
style.getOrCreate<ModelSymbol>()->autoScale() = true;
style.getOrCreate<ModelSymbol>()->url()->setLiteral("../data/red_flag.osg.50.scale");
ModelNode* modelNode = new ModelNode(mapNode, style);
modelNode->setPosition(GeoPoint(geoSRS, -100, 52));
annoGroup->addChild(modelNode);
}
//--------------------------------------------------------------------
// initialize the viewer:
viewer.setSceneData( root );
viewer.getCamera()->setSmallFeatureCullingPixelSize(-1.0f);
return viewer.run();
}
项目属性页
SDK版本、平台工具集
指定命令行参数
附加包含目录
D:\OSGCore\Bulid\OsgEarth\include;D:\OSGCore\Bulid\OpenSceneGraphic\include;
指定输入库
D:\OSGCore\Bulid\OsgEarth\lib\osgEarthUtil.lib
D:\OSGCore\Bulid\OsgEarth\lib\osgEarthAnnotation.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osg.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgDB.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgUtil.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgViewer.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\OpenThreads.lib
D:\OSGCore\Bulid\OsgEarth\lib\osgEarthFeatures.lib
D:\OSGCore\Bulid\OsgEarth\lib\osgEarthSymbology.lib
D:\OSGCore\Bulid\OsgEarth\lib\osgEarth.lib
ws2_32.lib
winmm.lib
wldap32.lib
psapi.lib
D:\OSGCore\Bulid\3rdParty\lib\libcurl_imp.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgWidget.lib
D:\OSGCore\Bulid\3rdParty\lib\gdal_i.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgSim.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgTerrain.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgFX.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgText.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgGA.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgShadow.lib
D:\OSGCore\Bulid\OpenSceneGraphic\lib\osgManipulator.lib
opengl32.lib
glu32.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
运行结果
上一篇: osgEarth源码编译(Win10+VS2019+OSG3.6.5+osgEarth2.10.0)
下一篇: osgEarth用ModelNode在指定经纬高绘制多边形
VS2019新建osgEarth项目时,GL.h文件提示报错相关推荐
- 求助 vs2019编辑C++项目:MSVC头文件大量报错
请教各位大神,我已经尝试过重装vs2019,重置所有配置,更新注册表vs2019缓存和共享的位置,安装win10sdk所有版本,都解决不了下面的问题. Microsoft Visual Studio\ ...
- 使用Maven创建Web项目后,jsp引入静态文件提示报错。JSP 报错:javax.servlet.ServletException cannot be resolved to a type...
用maven创建多模块的web工程后,不同于直接创建普通的web工程. 1.在普通的web工程创建后,在项目中会有tomcat等服务器的jar包,这时创建JSP文件肯定是没有错的: 2.即使是使用ma ...
- vs2019推送项目上自己的github账户报错
1.报错信息: could not read Username for 'https://github.com': terminal prompts disabled 解决方法: 打开项目所在的目录下 ...
- 使用vue-cli初始化项目时运行‘npm run dev’报错
npm run dev 无法启动 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli 'D:\\Program File ...
- 02 GitHub的基本使用与踩坑-从零创建项目,第一次的各种提示报错,一铲子填平!
之前介绍过Git的基本原理和常用的基本操作,有需要的小伙伴可参考博客: <穿越时空的git>科幻小电影-Git创建版本库和常用命令操作-提交.回退.撤销.删除 1.申请GitHub账号 这 ...
- 新建gradle项目时总在下载gradle.zip
在新建gradle项目时,总会出现download:https://services.gradle.org/distributions/gradle-3.4-bin.zip一直卡在那里不动. 原来是因 ...
- eclipse2022.6版本新建maven项目时pom报错:Cannot find the declaration of element ‘project‘. pom.xml
新建maven项目时,pom.xml文件默认是这样的: < project xmlns= " http://maven.apache.org/POM/4.0.0 " xmln ...
- IDEA第一次创建android太慢,idea新建maven项目时速度缓慢的解决方法
原因 IDEA根据maven archetype的本质,其实是执行mvn archetype:generate命令,该命令执行时,需要指定一个archetype-catalog.xml文件. 该命令的 ...
- weblogic下开发web项目时修改java文件不用重启的绿色方法,不用修改weblogic的配置文件、不用jar...
2019独角兽企业重金招聘Python工程师标准>>> weblogic下开发web项目时修改java文件不用重启的绿色方法,不用修改weblogic的配置文件.不用jar ...
- Ubuntu 新建qt项目时出现 No valid kits found.
Ubuntu 新建qt项目时出现 No valid kits found. 这是由于我们只安装了qtcreator而没有安装qt-sdk. 解决这个问题需要如下步骤: 如果需要需要qt-4和qt-5 ...
最新文章
- PAT(甲级)2018年冬季考试 7-1 Google Recruitment
- ASP.NET State Service
- Lua 函数、闭包、尾调用总结
- CTF短秘钥的RSA解密
- VUE—从入门到飞起(二)
- SqlParameter的作用与用法
- Apache Web Server - httpd 的文档根目录 及 访问控制
- Android之FLAG_ACTIVITY_SINGLE_TOP
- HDU 6168 Numbers 思维
- swift 数据存储
- 写于Silverlight整装待发之际【瞿杰】
- python如何获取鼠标位置_python实时得到鼠标的位置
- zblog仿站教程 - 常用模板标签
- Java类和对象 详解(二)
- MySQL批量造数据
- php stripslashes和addslashes的区别
- 合唱队形(NOIP)
- java对外接口安全问题_怎么保证对外暴露接口的安全性(调用频率限制)
- 单系统 台电x80pro_台电X80plus双系统刷单系统
- 30多种免费的高级WordPress主题,适用于令人惊叹的照片,教育和房地产网站