g++编译报错原因分析expected type-specifier before

博客指出C++编程中出现问题的原因是未引入相应头文件,加入对应的.h文件即可解决该问题,聚焦于C++编程的调试方面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原因:因为没有引入相应的头文件,加入相应的.h可以解决

In file included from include/mbgl/util/image.hpp:4, from platform/qt/src/qt_image.cpp:1: include/mbgl/util/geometry.hpp:9:24: error: found ‘:’ in nested-name-specifier, expected ‘::’ 9 | enum class FeatureType : uint8_t { | ^ | :: include/mbgl/util/geometry.hpp:9:12: error: ‘FeatureType’ has not been declared 9 | enum class FeatureType : uint8_t { | ^~~~~~~~~~~ include/mbgl/util/geometry.hpp:9:34: error: expected unqualified-id before ‘{’ token 9 | enum class FeatureType : uint8_t { | ^ include/mbgl/util/geometry.hpp:47:5: error: ‘FeatureType’ does not name a type; did you mean ‘ToFeatureType’? 47 | FeatureType operator()(const Point<T> &) const { return FeatureType::Point; } | ^~~~~~~~~~~ | ToFeatureType include/mbgl/util/geometry.hpp:49:5: error: ‘FeatureType’ does not name a type; did you mean ‘ToFeatureType’? 49 | FeatureType operator()(const MultiPoint<T> &) const { return FeatureType::Point; } | ^~~~~~~~~~~ | ToFeatureType include/mbgl/util/geometry.hpp:51:5: error: ‘FeatureType’ does not name a type; did you mean ‘ToFeatureType’? 51 | FeatureType operator()(const LineString<T> &) const { return FeatureType::LineString; } | ^~~~~~~~~~~ | ToFeatureType include/mbgl/util/geometry.hpp:53:5: error: ‘FeatureType’ does not name a type; did you mean ‘ToFeatureType’? 53 | FeatureType operator()(const MultiLineString<T> &) const { return FeatureType::LineString; } | ^~~~~~~~~~~ | ToFeatureType include/mbgl/util/geometry.hpp:55:5: error: ‘FeatureType’ does not name a type; did you mean ‘ToFeatureType’? 55 | FeatureType operator()(const Polygon<T> &) const { return FeatureType::Polygon; } | ^~~~~~~~~~~ | ToFeatureType include/mbgl/util/geometry.hpp:57:5: error: ‘FeatureType’ does not name a type; did you mean ‘ToFeatureType’? 57 | FeatureType operator()(const MultiPolygon<T> &) const { return FeatureType::Polygon; } | ^~~~~~~~~~~ | ToFeatureType include/mbgl/util/geometry.hpp:59:5: error: ‘FeatureType’ does not name a type; did you mean ‘ToFeatureType’? 59 | FeatureType operator()(const mapbox::geometry::geometry_collection<T> &) const { return FeatureType::Unknown; } | ^~~~~~~~~~~ | ToFeatureType make[5]: *** [Makefile:6161:.obj/platform/qt/src/qt_image.o] 错误 1 make[5]: *** 正在等待未完成的任务.... make[5]: 离开目录“/opt/qt-everywhere-src-5.15.17/qtlocation/src/3rdparty/mapbox-gl-native” make[4]: *** [Makefile:203:sub-------3rdparty-mapbox-gl-native-make_first] 错误 2 make[4]: 离开目录“/opt/qt-everywhere-src-5.15.17/qtlocation/src/plugins/geoservices” make[3]: *** [Makefile:73:sub-geoservices-make_first] 错误 2 make[3]: 离开目录“/opt/qt-everywhere-src-5.15.17/qtlocation/src/plugins” make[2]: *** [Makefile:234:sub-plugins-make_first] 错误 2 make[2]: 离开目录“/opt/qt-everywhere-src-5.15.17/qtlocation/src” make[1]: *** [Makefile:49:sub-src-make_first] 错误 2 make[1]: 离开目录“/opt/qt-everywhere-src-5.15.17/qtlocation” make: *** [Makefile:813:module-qtlocation] 错误 2
06-18
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值