作者:朱金灿
来源:http://blog.csdn.net/clever101
gdal库在集成libkml出现一些链接错误:
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::XalAddressDetails::XalAddressDetails(void)"(??0XalAddressDetails@kmldom@@AAE@XZ),该符号在函数"public: class kmldom::XalAddressDetails * __thiscall kmldom::KmlFactory::CreateXalAddressDetails(void)const"(?CreateXalAddressDetails@KmlFactory@kmldom@@QBEPAVXalAddressDetails@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::XalAdministrativeArea::XalAdministrativeArea(void)"(??0XalAdministrativeArea@kmldom@@AAE@XZ),该符号在函数"public: class kmldom::XalAdministrativeArea * __thiscall kmldom::KmlFactory::CreateXalAdministrativeArea(void)const"(?CreateXalAdministrativeArea@KmlFactory@kmldom@@QBEPAVXalAdministrativeArea@2@XZ)中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::XalCountry::XalCountry(void)" (??0XalCountry@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::XalCountry * __thiscallkmldom::KmlFactory::CreateXalCountry(void)const "(?CreateXalCountry@KmlFactory@kmldom@@QBEPAVXalCountry@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::XalLocality::XalLocality(void)" (??0XalLocality@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::XalLocality * __thiscallkmldom::KmlFactory::CreateXalLocality(void)const "(?CreateXalLocality@KmlFactory@kmldom@@QBEPAVXalLocality@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::XalPostalCode::XalPostalCode(void)"(??0XalPostalCode@kmldom@@AAE@XZ),该符号在函数"public: class kmldom::XalPostalCode * __thiscall kmldom::KmlFactory::CreateXalPostalCode(void)const" (?CreateXalPostalCode@KmlFactory@kmldom@@QBEPAVXalPostalCode@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::XalSubAdministrativeArea::XalSubAdministrativeArea(void)"(??0XalSubAdministrativeArea@kmldom@@AAE@XZ),该符号在函数"public: class kmldom::XalSubAdministrativeArea * __thiscallkmldom::KmlFactory::CreateXalSubAdministrativeArea(void)const "(?CreateXalSubAdministrativeArea@KmlFactory@kmldom@@QBEPAVXalSubAdministrativeArea@2@XZ)中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::XalThoroughfare::XalThoroughfare(void)"(??0XalThoroughfare@kmldom@@AAE@XZ),该符号在函数"public: class kmldom::XalThoroughfare * __thiscall kmldom::KmlFactory::CreateXalThoroughfare(void)const" (?CreateXalThoroughfare@KmlFactory@kmldom@@QBEPAVXalThoroughfare@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxAnimatedUpdate::GxAnimatedUpdate(void)" (??0GxAnimatedUpdate@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxAnimatedUpdate *__thiscall kmldom::KmlFactory::CreateGxAnimatedUpdate(void)const "(?CreateGxAnimatedUpdate@KmlFactory@kmldom@@QBEPAVGxAnimatedUpdate@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxFlyTo::GxFlyTo(void)" (??0GxFlyTo@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxFlyTo * __thiscallkmldom::KmlFactory::CreateGxFlyTo(void)const "(?CreateGxFlyTo@KmlFactory@kmldom@@QBEPAVGxFlyTo@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxPlaylist::GxPlaylist(void)" (??0GxPlaylist@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxPlaylist * __thiscallkmldom::KmlFactory::CreateGxPlaylist(void)const "(?CreateGxPlaylist@KmlFactory@kmldom@@QBEPAVGxPlaylist@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxSoundCue::GxSoundCue(void)" (??0GxSoundCue@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxSoundCue * __thiscallkmldom::KmlFactory::CreateGxSoundCue(void)const "(?CreateGxSoundCue@KmlFactory@kmldom@@QBEPAVGxSoundCue@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxTimeSpan::GxTimeSpan(void)" (??0GxTimeSpan@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxTimeSpan * __thiscallkmldom::KmlFactory::CreateGxTimeSpan(void)const "(?CreateGxTimeSpan@KmlFactory@kmldom@@QBEPAVGxTimeSpan@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxTimeStamp::GxTimeStamp(void)" (??0GxTimeStamp@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxTimeStamp * __thiscallkmldom::KmlFactory::CreateGxTimeStamp(void)const "(?CreateGxTimeStamp@KmlFactory@kmldom@@QBEPAVGxTimeStamp@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxTour::GxTour(void)" (??0GxTour@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxTour * __thiscallkmldom::KmlFactory::CreateGxTour(void)const "(?CreateGxTour@KmlFactory@kmldom@@QBEPAVGxTour@2@XZ) 中被引用
1>libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxTourControl::GxTourControl(void)"(??0GxTourControl@kmldom@@AAE@XZ),该符号在函数"public: class kmldom::GxTourControl * __thiscallkmldom::KmlFactory::CreateGxTourControl(void)const "(?CreateGxTourControl@KmlFactory@kmldom@@QBEPAVGxTourControl@2@XZ) 中被引用
1> libkmldomD.lib(kml_factory.obj): error LNK2019: 无法解析的外部符号 "private: __thiscallkmldom::GxWait::GxWait(void)" (??0GxWait@kmldom@@AAE@XZ),该符号在函数 "public: class kmldom::GxWait * __thiscallkmldom::KmlFactory::CreateGxWait(void)const "(?CreateGxWait@KmlFactory@kmldom@@QBEPAVGxWait@2@XZ) 中被引用。
开始感到莫名其妙,因为库文件我已经添加了,怎么还有这么多链接错误呢?然后重新编译libkml工程,再编译gdal工程,依然出现一样的错误。再仔细看下链接错误,发现诸如XalAddressDetails的头文件和cpp文件并没有加入到libkml工程,也就没有生成obj文件。我们知道库文件实际上是一个个obj连结在一起的,缺少obj文件外部链接时自然出现错误,因此解决这个问题的办法就是把libkml工程缺少的xal.h、xal.cc、gx_timeprimitive.h、gx_timeprimitive.cc、gx_tour.h和gx_tour.cc都加到libkml工程。