opensubscriber
   Find in this group all groups
 
Unknown more information…

m : mitab@yahoogroups.com 25 June 2009 • 3:23AM -0400

[mitab] Porblem using GDAL v 1.6.0 and MITAB v 1.7.0 together in one routine
by adeel_razza

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi,

I am trying to import a spacial reference system into an OGRSpatialReference object using the following function which requires a MapInfo style CoordSys definition string: OGRErr OGRSpatialReference::importFromMICoordSys(const char * pszCoordSys) (websited address: http://www.gdal.org/ogr/classOGRSpatialReference.html#1acf0f6cac3125cc878a99433033c140). This function requires the routine in which it is used to be linked to the MITAB library. The problem is that both the MITAB and GDAL libraries contain OGR and CPL. This creates the following linker errors when I try to compile my routine on Microsoft Visual C++ 2008 Express Edition (VC 9.0), using mitab version 1.7.0 and gdal version 1.6.0.


Linking...
LINK : C:\RayPredict\Source\Terrain Database Convertor\Debug\Terrain Database Convertor.exe not found or not built by the last incremental link; performing full link
mitab.lib(mitab_capi.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_imapinfofile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_miffile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tabfile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_feature.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_coordsys.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_bounds.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tabseamless.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tabview.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_utils.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_middatafile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_spatialref.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapheaderblock.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapfile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_datfile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_indfile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapobjectblock.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_feature_mif.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapcoordblock.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_rawbinblock.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_geometry.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_idfile.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_tooldef.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_mapindexblock.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
mitab.lib(mitab_maptoolblock.obj) : error LNK2005: "public: virtual int __thiscall OGRGeometry::IsSimple(void)const " (?IsSimple@OGRGeometry@@UBEHXZ) already defined in gdal_i-vc9.lib(gdal16-vc9.dll)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static unsigned int __cdecl std::char_traits::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string,class std::allocator >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in mitab.lib(mitab_capi.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in mitab.lib(mitab_capi.obj)
LINK : fatal error LNK1104: cannot open file 'libcp.lib'



Is there any way to compile the MITAB and GDAL library in the same C++ routine and avoid these errors?

Best Regards,
Adeel Raza.


Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.