记录Qgis编译过程及弯路

5619 Views

参考链接: 1、QGIS二次开发(1)—加载矢量、栅格图层(QGIS 2.14.16 && Qt-4.8.6 && VS2010 ) 2、QGIS编译—QGIS3.10.6 + Qt5.11.2 + VS2015 —32位版本 3、QGIS编译—QGIS3.22.4 + Qt5.15.3 + VS2019 —64位版本 4、Win10下通过源码编译安装QGIS

缘起:编译qgis是由于有个老代码用qgis写的,依赖VS2010,现在都更新了多少代,不想用这个IDE了,于是想编译一个高版本的,所以耐下心来找了一些资料,好在别人都记录的很完备,原想按照上面撸一遍就行了,没想到坐下来也有各种曲折,特此记录 上面编译链接博客都看了一遍,原博主的条理清晰,这篇文章也学习他的逻辑结构,只是中间遇到的问题不一样

目录

编译环境弯路1:关于VS 版本我走了一个弯路弯路2:Cygwin在线安装关于qgis-dev依赖库编译错误最后一步复制dll, 问题1最后一步复制dll, 问题2启动程序后 问题1

编译环境

(1)Windows 10 64位 专业版 (2)Visual Studio Professional 2022(64) (3)QGIS-3.22.4 源码(这是个长期版本) (4)CMake-3.23.2 64位(作用:来生成*.sln,VS工程文件) (5)Cygwin 64位 (在线安装版,要安装:flex库和bison库) (6)OSGeo4W 64位 (在线安装版,要安装:qgis-dev,这个不是一个库,这是一系列库文件具体详见下面)

弯路1:关于VS 版本我走了一个弯路

我想着原作者用vs2019都可以,我平常用的VS2017问题应该不大,但是编译不通过,具体原因:由于现在gdal库依赖proj库,proj库要求7.X以上,编译Proj7以上版本需要VS版本大于2017,所以VS就用了VS2022 为啥不用2019?因为我电脑上装了VS2017和VS2022,没事不想装那么多VS,所以就用了VS2022 OK?

弯路2:Cygwin在线安装

按照参考链接3进行编译, 原作者在图11这里只安装了bison库 新手不懂事,照着来在后面VS最终编译会提示缺少flex相关的库文件,所以再跑到这一步下载安装flex相关的库

关于qgis-dev依赖库

这个依赖不止一个库,有很多库。具体安装方法在参考链接3,图21 这里要注意的是不同的选择最后依赖库的版本是不同的,这也是编译最容易出错的地方

序号库名版本1gdal3102Pyhon3.123QT55.15.3

编译错误

按照博主的编译顺序进行:“按照“qgis_core”、“qgis_analysis”、“qgis_app”、“qgis_gui”、“ALL_BUILD”的顺序编译,不出意外的话将顺利完成。”

出了意外,而且很多意外。我在编译第一个“qgis_core”库的时候就出了很多错误,我把所有错误直接放下面:

74>feature.cpp

74>pointset.cpp

74>qgsgeos.cpp

74> 正在创建库 D:/VariousLib/QGIS3_2_4/QGIS_Build2/src/core/RelWithDebInfo/qgis_core.lib 和对象 D:/VariousLib/QGIS3_2_4/QGIS_Build2/src/core/RelWithDebInfo/qgis_core.exp

74>qgsvectortilewriter.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::OstreamView(struct absl::lts_20240116::log_internal::LogMessage::LogMessageData &)" (??0OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAA@AEAULogMessageData@1234@@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::OstreamView(struct absl::lts_20240116::log_internal::LogMessage::LogMessageData &)" (??0OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAA@AEAULogMessageData@1234@@Z)

74>qgsvectortilelayerrenderer.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::OstreamView(struct absl::lts_20240116::log_internal::LogMessage::LogMessageData &)" (??0OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAA@AEAULogMessageData@1234@@Z)

74>qgsvectortilemvtdecoder.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::OstreamView(struct absl::lts_20240116::log_internal::LogMessage::LogMessageData &)" (??0OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAA@AEAULogMessageData@1234@@Z)

74>qgsvectortilemvtencoder.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::OstreamView(struct absl::lts_20240116::log_internal::LogMessage::LogMessageData &)" (??0OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAA@AEAULogMessageData@1234@@Z)

74>qgsvectortileutils.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::OstreamView(struct absl::lts_20240116::log_internal::LogMessage::LogMessageData &)" (??0OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAA@AEAULogMessageData@1234@@Z)

74>qgsvectortilewriter.obj : error LNK2001: 无法解析的外部符号 "public: virtual __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::~OstreamView(void)" (??1OstreamView@LogMessage@log_internal@lts_20240116@absl@@UEAA@XZ)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: virtual __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::~OstreamView(void)" (??1OstreamView@LogMessage@log_internal@lts_20240116@absl@@UEAA@XZ)

74>qgsvectortilelayerrenderer.obj : error LNK2001: 无法解析的外部符号 "public: virtual __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::~OstreamView(void)" (??1OstreamView@LogMessage@log_internal@lts_20240116@absl@@UEAA@XZ)

74>qgsvectortilemvtdecoder.obj : error LNK2001: 无法解析的外部符号 "public: virtual __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::~OstreamView(void)" (??1OstreamView@LogMessage@log_internal@lts_20240116@absl@@UEAA@XZ)

74>qgsvectortilemvtencoder.obj : error LNK2001: 无法解析的外部符号 "public: virtual __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::~OstreamView(void)" (??1OstreamView@LogMessage@log_internal@lts_20240116@absl@@UEAA@XZ)

74>qgsvectortileutils.obj : error LNK2001: 无法解析的外部符号 "public: virtual __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::~OstreamView(void)" (??1OstreamView@LogMessage@log_internal@lts_20240116@absl@@UEAA@XZ)

74>qgsvectortilewriter.obj : error LNK2001: 无法解析的外部符号 "public: class std::basic_ostream > & __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::stream(void)" (?stream@OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: class std::basic_ostream > & __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::stream(void)" (?stream@OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)

74>qgsvectortilelayerrenderer.obj : error LNK2001: 无法解析的外部符号 "public: class std::basic_ostream > & __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::stream(void)" (?stream@OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)

74>qgsvectortilemvtdecoder.obj : error LNK2001: 无法解析的外部符号 "public: class std::basic_ostream > & __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::stream(void)" (?stream@OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)

74>qgsvectortilemvtencoder.obj : error LNK2001: 无法解析的外部符号 "public: class std::basic_ostream > & __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::stream(void)" (?stream@OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)

74>qgsvectortileutils.obj : error LNK2001: 无法解析的外部符号 "public: class std::basic_ostream > & __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::stream(void)" (?stream@OstreamView@LogMessage@log_internal@lts_20240116@absl@@QEAAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)

74>qgsvectortilemvtdecoder.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl absl::lts_20240116::log_internal::LogMessageFatal::~LogMessageFatal(void)" (??1LogMessageFatal@log_internal@lts_20240116@absl@@QEAA@XZ),函数 "public: class QMap > __cdecl QgsVectorTileMVTDecoder::layerFeatures(class QMap const &,class QgsCoordinateTransform const &,class QSet const *)const " (?layerFeatures@QgsVectorTileMVTDecoder@@QEBA?AV?$QMap@VQString@@V?$QVector@VQgsFeature@@@@@@AEBV?$QMap@VQString@@VQgsFields@@@@AEBVQgsCoordinateTransform@@PEBV?$QSet@VQString@@@@@Z) 中引用了该符号

74>qgsvectortilemvtdecoder.obj : error LNK2019: 无法解析的外部符号 "public: bool __cdecl google::protobuf::MessageLite::ParseFromArray(void const *,int)" (?ParseFromArray@MessageLite@protobuf@google@@QEAA_NPEBXH@Z),函数 "public: bool __cdecl QgsVectorTileMVTDecoder::decode(class QgsTileXYZ,class QByteArray const &)" (?decode@QgsVectorTileMVTDecoder@@QEAA_NVQgsTileXYZ@@AEBVQByteArray@@@Z) 中引用了该符号

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "private: void __cdecl absl::lts_20240116::log_internal::LogMessage::CopyToEncodedBuffer<0>(class absl::lts_20240116::string_view)" (??$CopyToEncodedBuffer@$0A@@LogMessage@log_internal@lts_20240116@absl@@AEAAXVstring_view@23@@Z),函数 "public: class absl::lts_20240116::log_internal::LogMessage & __cdecl absl::lts_20240116::log_internal::LogMessage::operator<<<2>(char const (&)[2])" (??$?6$01@LogMessage@log_internal@lts_20240116@absl@@QEAAAEAV0123@AEAY01$$CBD@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "private: void __cdecl absl::lts_20240116::log_internal::LogMessage::CopyToEncodedBuffer<0>(class absl::lts_20240116::string_view)" (??$CopyToEncodedBuffer@$0A@@LogMessage@log_internal@lts_20240116@absl@@AEAAXVstring_view@23@@Z)

74>qgsvectortilemvtencoder.obj : error LNK2001: 无法解析的外部符号 "class std::basic_string,class std::allocator > * __cdecl absl::lts_20240116::log_internal::MakeCheckOpString(unsigned __int64,unsigned __int64,char const *)" (??$MakeCheckOpString@_K_K@log_internal@lts_20240116@absl@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_K0PEBD@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "class std::basic_string,class std::allocator > * __cdecl absl::lts_20240116::log_internal::MakeCheckOpString(unsigned __int64,unsigned __int64,char const *)" (??$MakeCheckOpString@_K_K@log_internal@lts_20240116@absl@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_K0PEBD@Z)

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "private: void * __cdecl google::protobuf::Arena::Allocate(unsigned __int64)" (?Allocate@Arena@protobuf@google@@AEAAPEAX_K@Z),函数 "private: static void * __cdecl google::protobuf::Arena::DefaultConstruct(class google::protobuf::Arena *)" (??$DefaultConstruct@VTile_Feature@vector_tile@@@Arena@protobuf@google@@CAPEAXPEAV012@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "private: void * __cdecl google::protobuf::Arena::Allocate(unsigned __int64)" (?Allocate@Arena@protobuf@google@@AEAAPEAX_K@Z)

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "private: void * __cdecl google::protobuf::Arena::AllocateForArray(unsigned __int64)" (?AllocateForArray@Arena@protobuf@google@@AEAAPEAX_K@Z),函数 "private: void __cdecl google::protobuf::RepeatedField::GrowNoAnnotate(bool,int,int)" (?GrowNoAnnotate@?$RepeatedField@I@protobuf@google@@AEAAX_NHH@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "private: void * __cdecl google::protobuf::Arena::AllocateForArray(unsigned __int64)" (?AllocateForArray@Arena@protobuf@google@@AEAAPEAX_K@Z)

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(class absl::lts_20240116::string_view,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@protobuf@google@@QEAAXVstring_view@lts_20240116@absl@@PEAVArena@34@@Z),函数 "public: void __cdecl vector_tile::Tile_Layer::set_name(class QByteArray &&)" (??$set_name@VQByteArray@@$$V@Tile_Layer@vector_tile@@QEAAX$$QEAVQByteArray@@@Z) 中引用了该符号

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(class std::basic_string,class std::allocator > &&,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@protobuf@google@@QEAAX$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z),函数 "public: void __cdecl vector_tile::Tile_Value::set_string_value,class std::allocator > >(class std::basic_string,class std::allocator > &&)" (??$set_string_value@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$V@Tile_Value@vector_tile@@QEAAX$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "public: class std::basic_string,class std::allocator > __cdecl google::protobuf::MessageLite::SerializeAsString(void)const " (?SerializeAsString@MessageLite@protobuf@google@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ),函数 "public: class QByteArray __cdecl QgsVectorTileMVTEncoder::encode(void)const " (?encode@QgsVectorTileMVTEncoder@@QEBA?AVQByteArray@@XZ) 中引用了该符号

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "private: void * __cdecl google::protobuf::internal::RepeatedPtrFieldBase::AddMessageLite(void * (__cdecl*)(class google::protobuf::Arena *))" (?AddMessageLite@RepeatedPtrFieldBase@internal@protobuf@google@@AEAAPEAXP6APEAXPEAVArena@34@@Z@Z),函数 "private: void __cdecl QgsVectorTileMVTEncoder::addFeature(class vector_tile::Tile_Layer *,class QgsFeature const &)" (?addFeature@QgsVectorTileMVTEncoder@@AEAAXPEAVTile_Layer@vector_tile@@AEBVQgsFeature@@@Z) 中引用了该符号

74>qgsvectortilemvtencoder.obj : error LNK2019: 无法解析的外部符号 "private: void * __cdecl google::protobuf::internal::RepeatedPtrFieldBase::AddString(void)" (?AddString@RepeatedPtrFieldBase@internal@protobuf@google@@AEAAPEAXXZ),函数 "void __cdecl google::protobuf::internal::AddToRepeatedPtrField(class google::protobuf::RepeatedPtrField,class std::allocator > > &,class QByteArray &&)" (??$AddToRepeatedPtrField@VQByteArray@@$$V@internal@protobuf@google@@YAXAEAV?$RepeatedPtrField@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@12@$$QEAVQByteArray@@@Z) 中引用了该符号

74>qgsvectortilemvtencoder.obj : error LNK2001: 无法解析的外部符号 "void * __cdecl google::protobuf::internal::NewStringElement(class google::protobuf::Arena *)" (?NewStringElement@internal@protobuf@google@@YAPEAXPEAVArena@23@@Z)

74>qgsvectortilemvtencoder.obj : error LNK2001: 无法解析的外部符号 "private: static struct google::protobuf::internal::ThreadSafeArena::ThreadCache google::protobuf::internal::ThreadSafeArena::thread_cache_" (?thread_cache_@ThreadSafeArena@internal@protobuf@google@@0UThreadCache@1234@A)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "private: static struct google::protobuf::internal::ThreadSafeArena::ThreadCache google::protobuf::internal::ThreadSafeArena::thread_cache_" (?thread_cache_@ThreadSafeArena@internal@protobuf@google@@0UThreadCache@1234@A)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "class google::protobuf::internal::ExplicitlyConstructed,class std::allocator >,8> google::protobuf::internal::fixed_address_empty_string" (?fixed_address_empty_string@internal@protobuf@google@@3V?$ExplicitlyConstructed@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$07@123@A)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::GenericFallbackLite(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?GenericFallbackLite@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastF32S1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastF32S1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastF64S1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastF64S1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastV8S1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastV8S1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastV32S1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastV32S1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastV32P1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastV32P1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastV64S1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastV64S1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastZ64S1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastZ64S1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastEr0S1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastEr0S1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastBS1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastBS1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastBR1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastBR1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::FastMtR1(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?FastMtR1@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "public: static char const * __cdecl google::protobuf::internal::TcParser::MiniParse(class google::protobuf::MessageLite *,char const *,class google::protobuf::internal::ParseContext *,struct google::protobuf::internal::TcFieldData,struct google::protobuf::internal::TcParseTableBase const *,unsigned __int64)" (?MiniParse@TcParser@internal@protobuf@google@@SAPEBDPEAVMessageLite@34@PEBDPEAVParseContext@234@UTcFieldData@234@PEBUTcParseTableBase@234@_K@Z)

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char *)" (?EnsureSpaceFallback@EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEPEAE@Z),函数 "public: virtual unsigned char * __cdecl vector_tile::Tile_Value::_InternalSerialize(unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)const " (?_InternalSerialize@Tile_Value@vector_tile@@UEBAPEAEPEAEPEAVEpsCopyOutputStream@io@protobuf@google@@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteRawFallback(void const *,int,unsigned char *)" (?WriteRawFallback@EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEPEBXHPEAE@Z),函数 "public: virtual unsigned char * __cdecl vector_tile::Tile_Value::_InternalSerialize(unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)const " (?_InternalSerialize@Tile_Value@vector_tile@@UEBAPEAEPEAEPEAVEpsCopyOutputStream@io@protobuf@google@@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliasedOutline(unsigned int,class std::basic_string,class std::allocator > const &,unsigned char *)" (?WriteStringMaybeAliasedOutline@EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEIAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAE@Z),函数 "public: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliased(unsigned int,class std::basic_string,class std::allocator > const &,unsigned char *)" (?WriteStringMaybeAliased@EpsCopyOutputStream@io@protobuf@google@@QEAAPEAEIAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAE@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int,class std::basic_string,class std::allocator > const &,unsigned char *)" (?WriteStringOutline@EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEIAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAE@Z),函数 "public: virtual unsigned char * __cdecl vector_tile::Tile_Layer::_InternalSerialize(unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)const " (?_InternalSerialize@Tile_Layer@vector_tile@@UEBAPEAEPEAEPEAVEpsCopyOutputStream@io@protobuf@google@@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void * __cdecl google::protobuf::internal::ThreadSafeArena::AllocateFromStringBlock(void)" (?AllocateFromStringBlock@ThreadSafeArena@internal@protobuf@google@@QEAAPEAXXZ),函数 "auto __cdecl absl::lts_20240116::utility_internal::IfConstexprElse<0,class ,class ,class std::basic_string,class std::allocator > >(class &&,class &&,class std::basic_string,class std::allocator > &&)" (??$IfConstexprElse@$0A@V@@V@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@utility_internal@lts_20240116@absl@@YA?A_P$$QEAV@@$$QEAV@@$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: class google::protobuf::internal::TaggedStringPtr __cdecl google::protobuf::internal::TaggedStringPtr::ForceCopy(class google::protobuf::Arena *)const " (?ForceCopy@TaggedStringPtr@internal@protobuf@google@@AEBA?AV1234@PEAVArena@34@@Z),函数 "protected: __cdecl vector_tile::Tile_Layer::Tile_Layer(class google::protobuf::Arena *,class vector_tile::Tile_Layer const &)" (??0Tile_Layer@vector_tile@@IEAA@PEAVArena@protobuf@google@@AEBV01@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Destroy(void)" (?Destroy@ArenaStringPtr@internal@protobuf@google@@QEAAXXZ),函数 "public: virtual __cdecl vector_tile::Tile_Layer::~Tile_Layer(void)" (??1Tile_Layer@vector_tile@@UEAA@XZ) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set<>(class std::basic_string,class std::allocator > const &,class google::protobuf::Arena *)" (??$Set@$$V@ArenaStringPtr@internal@protobuf@google@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@23@@Z),函数 "private: static void __cdecl vector_tile::Tile_Value::MergeImpl(class google::protobuf::MessageLite &,class google::protobuf::MessageLite const &)" (?MergeImpl@Tile_Value@vector_tile@@CAXAEAVMessageLite@protobuf@google@@AEBV345@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: void __cdecl google::protobuf::internal::InternalMetadata::DoClear,class std::allocator > >(void)" (??$DoClear@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@InternalMetadata@internal@protobuf@google@@AEAAXXZ),函数 "public: virtual void __cdecl vector_tile::Tile_Value::Clear(void)" (?Clear@Tile_Value@vector_tile@@UEAAXXZ) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: void __cdecl google::protobuf::internal::InternalMetadata::DoMergeFrom,class std::allocator > >(class std::basic_string,class std::allocator > const &)" (??$DoMergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@InternalMetadata@internal@protobuf@google@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z),函数 "private: static void __cdecl vector_tile::Tile_Value::MergeImpl(class google::protobuf::MessageLite &,class google::protobuf::MessageLite const &)" (?MergeImpl@Tile_Value@vector_tile@@CAXAEAVMessageLite@protobuf@google@@AEBV345@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::LookUpEnumValue(struct google::protobuf::internal::EnumEntry const *,unsigned __int64,class absl::lts_20240116::string_view,int *)" (?LookUpEnumValue@internal@protobuf@google@@YA_NPEBUEnumEntry@123@_KVstring_view@lts_20240116@absl@@PEAH@Z),函数 "bool __cdecl vector_tile::Tile_GeomType_Parse(class absl::lts_20240116::string_view,enum vector_tile::Tile_GeomType *)" (?Tile_GeomType_Parse@vector_tile@@YA_NVstring_view@lts_20240116@absl@@PEAW4Tile_GeomType@1@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "int __cdecl google::protobuf::internal::LookUpEnumName(struct google::protobuf::internal::EnumEntry const *,int const *,unsigned __int64,int)" (?LookUpEnumName@internal@protobuf@google@@YAHPEBUEnumEntry@123@PEBH_KH@Z),函数 "class std::basic_string,class std::allocator > const & __cdecl vector_tile::Tile_GeomType_Name(enum vector_tile::Tile_GeomType)" (?Tile_GeomType_Name@vector_tile@@YAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4Tile_GeomType@1@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::InitializeEnumStrings(struct google::protobuf::internal::EnumEntry const *,int const *,unsigned __int64,class google::protobuf::internal::ExplicitlyConstructed,class std::allocator >,1> *)" (?InitializeEnumStrings@internal@protobuf@google@@YA_NPEBUEnumEntry@123@PEBH_KPEAV?$ExplicitlyConstructed@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$00@123@@Z),函数 "class std::basic_string,class std::allocator > const & __cdecl vector_tile::Tile_GeomType_Name(enum vector_tile::Tile_GeomType)" (?Tile_GeomType_Name@vector_tile@@YAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4Tile_GeomType@1@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "protected: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::DestroyProtos(void)" (?DestroyProtos@RepeatedPtrFieldBase@internal@protobuf@google@@IEAAXXZ),函数 "public: __cdecl google::protobuf::RepeatedPtrField::~RepeatedPtrField(void)" (??1?$RepeatedPtrField@VTile_Feature@vector_tile@@@protobuf@google@@QEAA@XZ) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "void __cdecl google::protobuf::internal::memswap<16>(char *,char *)" (??$memswap@$0BA@@internal@protobuf@google@@YAXPEAD0@Z),函数 "private: void __cdecl vector_tile::Tile::InternalSwap(class vector_tile::Tile *)" (?InternalSwap@Tile@vector_tile@@AEAAXPEAV12@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::MergeFrom(class google::protobuf::internal::RepeatedPtrFieldBase const &)" (??$MergeFrom@VMessageLite@protobuf@google@@@RepeatedPtrFieldBase@internal@protobuf@google@@QEAAXAEBV0123@@Z),函数 "private: static void __cdecl vector_tile::Tile_Layer::MergeImpl(class google::protobuf::MessageLite &,class google::protobuf::MessageLite const &)" (?MergeImpl@Tile_Layer@vector_tile@@CAXAEAVMessageLite@protobuf@google@@AEBV345@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::MergeFrom,class std::allocator > >(class google::protobuf::internal::RepeatedPtrFieldBase const &)" (??$MergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@RepeatedPtrFieldBase@internal@protobuf@google@@QEAAXAEBV0123@@Z),函数 "private: static void __cdecl vector_tile::Tile_Layer::MergeImpl(class google::protobuf::MessageLite &,class google::protobuf::MessageLite const &)" (?MergeImpl@Tile_Layer@vector_tile@@CAXAEAVMessageLite@protobuf@google@@AEBV345@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: static unsigned char * __cdecl google::protobuf::internal::WireFormatLite::InternalWriteMessage(int,class google::protobuf::MessageLite const &,int,unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)" (?InternalWriteMessage@WireFormatLite@internal@protobuf@google@@SAPEAEHAEBVMessageLite@34@HPEAEPEAVEpsCopyOutputStream@io@34@@Z),函数 "public: virtual unsigned char * __cdecl vector_tile::Tile_Layer::_InternalSerialize(unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)const " (?_InternalSerialize@Tile_Layer@vector_tile@@UEBAPEAEPEAEPEAVEpsCopyOutputStream@io@protobuf@google@@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::UInt32SizeWithPackedTagSize(class google::protobuf::RepeatedField const &,unsigned __int64,class google::protobuf::internal::CachedSize const &)" (?UInt32SizeWithPackedTagSize@WireFormatLite@internal@protobuf@google@@SA_KAEBV?$RepeatedField@I@34@_KAEBVCachedSize@234@@Z),函数 "public: virtual unsigned __int64 __cdecl vector_tile::Tile_Feature::ByteSizeLong(void)const " (?ByteSizeLong@Tile_Feature@vector_tile@@UEBA_KXZ) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "void __cdecl google::protobuf::internal::InitProtobufDefaultsSlow(void)" (?InitProtobufDefaultsSlow@internal@protobuf@google@@YAXXZ),函数 "class std::basic_string,class std::allocator > const & __cdecl google::protobuf::internal::GetEmptyString(void)" (?GetEmptyString@internal@protobuf@google@@YAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl google::protobuf::internal::ExtensionSet::~ExtensionSet(void)" (??1ExtensionSet@internal@protobuf@google@@QEAA@XZ),函数 "int `protected: __cdecl vector_tile::Tile::Tile(class google::protobuf::Arena *,class Tile::dtor$0 const &)'::`1'::dtor$0" (?dtor$0@?0???0Tile@vector_tile@@IEAA@PEAVArena@protobuf@google@@AEBV01@@Z@4HA) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::ExtensionSet::Clear(void)" (?Clear@ExtensionSet@internal@protobuf@google@@QEAAXXZ),函数 "public: virtual void __cdecl vector_tile::Tile_Value::Clear(void)" (?Clear@Tile_Value@vector_tile@@UEAAXXZ) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::ExtensionSet::MergeFrom(class google::protobuf::MessageLite const *,class google::protobuf::internal::ExtensionSet const &)" (?MergeFrom@ExtensionSet@internal@protobuf@google@@QEAAXPEBVMessageLite@34@AEBV1234@@Z),函数 "private: static void __cdecl vector_tile::Tile_Value::MergeImpl(class google::protobuf::MessageLite &,class google::protobuf::MessageLite const &)" (?MergeImpl@Tile_Value@vector_tile@@CAXAEAVMessageLite@protobuf@google@@AEBV345@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl google::protobuf::internal::ExtensionSet::InternalSwap(class google::protobuf::internal::ExtensionSet *)" (?InternalSwap@ExtensionSet@internal@protobuf@google@@QEAAXPEAV1234@@Z),函数 "private: void __cdecl vector_tile::Tile::InternalSwap(class vector_tile::Tile *)" (?InternalSwap@Tile@vector_tile@@AEAAXPEAV12@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: bool __cdecl google::protobuf::internal::ExtensionSet::IsInitialized(class google::protobuf::MessageLite const *)const " (?IsInitialized@ExtensionSet@internal@protobuf@google@@QEBA_NPEBVMessageLite@34@@Z),函数 "private: static bool __cdecl vector_tile::Tile_Value::IsInitializedImpl(class google::protobuf::MessageLite const &)" (?IsInitializedImpl@Tile_Value@vector_tile@@CA_NAEBVMessageLite@protobuf@google@@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "public: unsigned __int64 __cdecl google::protobuf::internal::ExtensionSet::ByteSize(void)const " (?ByteSize@ExtensionSet@internal@protobuf@google@@QEBA_KXZ),函数 "public: virtual unsigned __int64 __cdecl vector_tile::Tile_Value::ByteSizeLong(void)const " (?ByteSizeLong@Tile_Value@vector_tile@@UEBA_KXZ) 中引用了该符号

74>vector_tile.pb.obj : error LNK2019: 无法解析的外部符号 "private: unsigned char * __cdecl google::protobuf::internal::ExtensionSet::_InternalSerializeImpl(class google::protobuf::MessageLite const *,int,int,unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)const " (?_InternalSerializeImpl@ExtensionSet@internal@protobuf@google@@AEBAPEAEPEBVMessageLite@34@HHPEAEPEAVEpsCopyOutputStream@io@34@@Z),函数 "public: virtual unsigned char * __cdecl vector_tile::Tile_Value::_InternalSerialize(unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)const " (?_InternalSerialize@Tile_Value@vector_tile@@UEBAPEAEPEAEPEAVEpsCopyOutputStream@io@protobuf@google@@@Z) 中引用了该符号

74>vector_tile.pb.obj : error LNK2001: 无法解析的外部符号 "struct std::atomic google::protobuf::internal::init_protobuf_defaults_state" (?init_protobuf_defaults_state@internal@protobuf@google@@3U?$atomic@_N@std@@A)

74>D:\VariousLib\QGIS3_2_4\QGIS_Build2\output\bin\RelWithDebInfo\qgis_core.dll : fatal error LNK1120: 58 个无法解析的外部命令

74>已完成生成项目“qgis_core.vcxproj”的操作 - 失败。

出现这么多错误,都是LINK错误,人都麻了。 冷静下来排除问题(过了一个周六周末),首先第一印象就是缺少对应的cpp文件或者lib文件,但是可能哪里出问题了呢,编译错误太多了,不用管,只分析第一个出错地方的位置: “public: __cdecl absl::lts_20240116::log_internal::LogMessage::OstreamView::OstreamView(struct absl::lts_20240116::log_internal::LogMessage::LogMessageData &)” 这个错误说absl域下的一个函数找不到了,而且可能与log_internal相关 查到了如下的一个链接: Protobuf 25.3系列3-生成和运行 好家伙,他直接该cmakelist文件里面,重新自己设置进去。我也效仿他的办法。 首先用everything搜索到我电脑中有absl相关lib,而且就在在线安装的OSGeo4W依赖lib中,如下图,absl打头的都是 把这些absl相关库的绝对路径全都复制出来(总共86个,我才用notepad++批量修改)

C:\OSGeo4W\lib\absl_bad_any_cast_impl.lib

C:\OSGeo4W\lib\absl_bad_optional_access.lib

C:\OSGeo4W\lib\absl_bad_variant_access.lib

C:\OSGeo4W\lib\absl_base.lib

C:\OSGeo4W\lib\absl_city.lib

C:\OSGeo4W\lib\absl_civil_time.lib

C:\OSGeo4W\lib\absl_cord.lib

C:\OSGeo4W\lib\absl_cordz_functions.lib

C:\OSGeo4W\lib\absl_cordz_handle.lib

C:\OSGeo4W\lib\absl_cordz_info.lib

C:\OSGeo4W\lib\absl_cordz_sample_token.lib

C:\OSGeo4W\lib\absl_cord_internal.lib

C:\OSGeo4W\lib\absl_crc32c.lib

C:\OSGeo4W\lib\absl_crc_cord_state.lib

C:\OSGeo4W\lib\absl_crc_cpu_detect.lib

C:\OSGeo4W\lib\absl_crc_internal.lib

C:\OSGeo4W\lib\absl_debugging_internal.lib

C:\OSGeo4W\lib\absl_demangle_internal.lib

C:\OSGeo4W\lib\absl_die_if_null.lib

C:\OSGeo4W\lib\absl_examine_stack.lib

C:\OSGeo4W\lib\absl_exponential_biased.lib

C:\OSGeo4W\lib\absl_failure_signal_handler.lib

C:\OSGeo4W\lib\absl_flags_commandlineflag.lib

C:\OSGeo4W\lib\absl_flags_commandlineflag_internal.lib

C:\OSGeo4W\lib\absl_flags_config.lib

C:\OSGeo4W\lib\absl_flags_internal.lib

C:\OSGeo4W\lib\absl_flags_marshalling.lib

C:\OSGeo4W\lib\absl_flags_parse.lib

C:\OSGeo4W\lib\absl_flags_private_handle_accessor.lib

C:\OSGeo4W\lib\absl_flags_program_name.lib

C:\OSGeo4W\lib\absl_flags_reflection.lib

C:\OSGeo4W\lib\absl_flags_usage.lib

C:\OSGeo4W\lib\absl_flags_usage_internal.lib

C:\OSGeo4W\lib\absl_graphcycles_internal.lib

C:\OSGeo4W\lib\absl_hash.lib

C:\OSGeo4W\lib\absl_hashtablez_sampler.lib

C:\OSGeo4W\lib\absl_int128.lib

C:\OSGeo4W\lib\absl_kernel_timeout_internal.lib

C:\OSGeo4W\lib\absl_leak_check.lib

C:\OSGeo4W\lib\absl_log_entry.lib

C:\OSGeo4W\lib\absl_log_flags.lib

C:\OSGeo4W\lib\absl_log_globals.lib

C:\OSGeo4W\lib\absl_log_initialize.lib

C:\OSGeo4W\lib\absl_log_internal_check_op.lib

C:\OSGeo4W\lib\absl_log_internal_conditions.lib

C:\OSGeo4W\lib\absl_log_internal_fnmatch.lib

C:\OSGeo4W\lib\absl_log_internal_format.lib

C:\OSGeo4W\lib\absl_log_internal_globals.lib

C:\OSGeo4W\lib\absl_log_internal_log_sink_set.lib

C:\OSGeo4W\lib\absl_log_internal_message.lib

C:\OSGeo4W\lib\absl_log_internal_nullguard.lib

C:\OSGeo4W\lib\absl_log_internal_proto.lib

C:\OSGeo4W\lib\absl_log_severity.lib

C:\OSGeo4W\lib\absl_log_sink.lib

C:\OSGeo4W\lib\absl_low_level_hash.lib

C:\OSGeo4W\lib\absl_malloc_internal.lib

C:\OSGeo4W\lib\absl_periodic_sampler.lib

C:\OSGeo4W\lib\absl_random_distributions.lib

C:\OSGeo4W\lib\absl_random_internal_distribution_test_util.lib

C:\OSGeo4W\lib\absl_random_internal_platform.lib

C:\OSGeo4W\lib\absl_random_internal_pool_urbg.lib

C:\OSGeo4W\lib\absl_random_internal_randen.lib

C:\OSGeo4W\lib\absl_random_internal_randen_hwaes.lib

C:\OSGeo4W\lib\absl_random_internal_randen_hwaes_impl.lib

C:\OSGeo4W\lib\absl_random_internal_randen_slow.lib

C:\OSGeo4W\lib\absl_random_internal_seed_material.lib

C:\OSGeo4W\lib\absl_random_seed_gen_exception.lib

C:\OSGeo4W\lib\absl_random_seed_sequences.lib

C:\OSGeo4W\lib\absl_raw_hash_set.lib

C:\OSGeo4W\lib\absl_raw_logging_internal.lib

C:\OSGeo4W\lib\absl_scoped_set_env.lib

C:\OSGeo4W\lib\absl_spinlock_wait.lib

C:\OSGeo4W\lib\absl_stacktrace.lib

C:\OSGeo4W\lib\absl_status.lib

C:\OSGeo4W\lib\absl_statusor.lib

C:\OSGeo4W\lib\absl_strerror.lib

C:\OSGeo4W\lib\absl_strings.lib

C:\OSGeo4W\lib\absl_strings_internal.lib

C:\OSGeo4W\lib\absl_string_view.lib

C:\OSGeo4W\lib\absl_str_format_internal.lib

C:\OSGeo4W\lib\absl_symbolize.lib

C:\OSGeo4W\lib\absl_synchronization.lib

C:\OSGeo4W\lib\absl_throw_delegate.lib

C:\OSGeo4W\lib\absl_time.lib

C:\OSGeo4W\lib\absl_time_zone.lib

C:\OSGeo4W\lib\absl_vlog_config_internal.lib

以绝对路径方式设置到附加依赖lib中,如下图 再编译一遍的时候发现问题消失了,但是还是有错误,说明这种方式是有效的,所以每次出问题都采用这种方式进行,再追加了几个lib就顺利编译过去了,具体如下几个lib

C:\OSGeo4W\lib\libprotobuf.lib

C:\OSGeo4W\lib\utf8_range.lib

C:\OSGeo4W\lib\utf8_validity.lib

这里不得不说OSGeo4W的qgis-dev库太全了,要不然一个个解决还不知道要搞到啥时候。

另外编译顺序也是有问题,其实编译顺序都是无关紧要的,在编译哪个库出现LINK问题,就针对那个库进行把lib引入进来即可。逢山开路,遇水搭桥。我在这里举出一个例子,在All_BUILD中又中断了,错误信息输出如下: 注意我红框中的信息。针对“test_core_vectortilewriter”项目单独设置,还是把basl相关的lib都扔进去 对该项目单独编译,顺利通过。

最后一步复制dll, 问题1

将“C:\cygwin64\bin”、“C:\OSGeo4W\bin”和“C:\OSGeo4W\apps\Qt5\bin”(三个文件路径)下所有dll文件,拷贝到“%构建目录%\output\bin\RelWithDebInfo”下,即“qgis.exe”所在目录下。其中,%构建目录%是指CMake的“Where to build the binaries”指向的目录。 我的程序编译目录,如下:

D:\VariousLib\QGIS3_2_4\QGIS_Build2\output\bin\RelWithDebInfo

按照上面复制后,直接双击qgis.exe运行出错了,如下截图: 参考链接: 1、Could not load qgis_app.dll QGIS无法启动,提示无法加载qgis_app.dll 2、qgis启动提示Could not load qgis_app.dll 上面两个参考链接有一定参考价值,参考链接1说缺少动态库导致的,参考链接2教你怎样找那个缺失的动态库,然而,我按照参考链接2操作,程序顺利启动了,没有这个错误提示。很尴尬 如下:

于是分析这个脚本执行了什么东西,后面注意到这两个环境脚本 仔细分析后原来作者漏掉了将apps\gdal\bin下面动态库复制过去,导致虽然gdla动态库缺少依赖项,无法正常启动。 所以解决方案:将下面dll复制到qgis程序编译所在的同级目录下

最后一步复制dll, 问题2

以为这么复制过去就好了,然而双击程序,出现如下报错界面 这个问题我熟悉,毕竟才学了QT,应该是QT运行依赖环境有问题 QT5程序正常发布,要用到自带的这个工具“windeployqt.exe” 卧槽,RelWithDebInfo版本不认识,那就手动复制文件来让QT正常吧 查了一下资料,应该就是platforms文件夹没有 解决方案: platforms文件夹存在plugings里,把该文件夹直接复制到程序运行目录

双击后,程序启动了 很高兴!!

启动程序后 问题1

启动程序后界面如下 有点懵逼,刚刚用bat脚本启动对比好像缺少点东西,如下

图标不能正常显示,哎算了,应该是QT资源路径问题。这里懒得解决了,至少可以进行二次开发了!

一路坎坎坷坷,周四周五就开搞,今天才基本成功了。特此记录

進化之地boss怎麽打 進化之地最終boss攻略(攻略)
短鲷缸布置有讲究,首次饲养必看注意事项