[gdal-dev] how to build dwg driver?

Ivan Lucena lucena_ivan at hotmail.com
Tue Sep 15 08:40:21 PDT 2015


Hi Mark,

Sorry for taking so long to reply.

Here is where I am with that:

I downloaded three different versions of the Teigha Extension (TX) SDK:

TX_SDK_3.05.0.0
TX_SDK_3.09.1.0
TX_SDK_4.01.0.0

I setup my nmake.local variables according to each one of those SDK version and tried to build against each one of them.

# ================
# DWG GDAL plugin
# ================

# DWG support using the Open Design Alliance Teigha Libraries

TD_BASE = C:\Dev\GDAL\TX_SDK_4.01.0.0
#TD_BASE = C:\Dev\GDAL\TX_SDK_3.05.0.0
TD_FLAGS = -D_TOOLKIT_IN_DLL_
TD_INCLUDE = -I$(TD_BASE)\Core\Include -I$(TD_BASE)\Core\Extensions\ExServices
#TD_INCLUDE = -I$(TD_BASE)\TD\Include -I$(TD_BASE)\TD\Extensions\ExServices
!IFDEF WIN32BIT
TD_LIBDIR = $(TD_BASE)\lib\v10dll
!ELSE
TD_LIBDIR = $(TD_BASE)\lib\vc10_amd64dll 
!ENDIF

Note that there is a little difference on the folder names of the latest one, "TD" now is "Core":

Before build the plugin, I build the project on $(TD_BASE)\Platform\vc10_amd64dll\ODA_vc10_amd64dll.sln to generate the library TD_ExamplesCommon.lib  required by ogr\ogrsf_frmts\dwg\nmakefile.vc.

There are other library files that are missing on the all the SDK versions that I tried, so I commented it:

TD_LIBS =  \
    $(TD_LIBDIR)/TD_ExamplesCommon.lib \
#    $(TD_LIBDIR)/TD_Key.lib \
    $(TD_LIBDIR)/ModelerGeometry.lib \
    $(TD_LIBDIR)/TD_BrepRenderer.lib \
    $(TD_LIBDIR)/TD_Br.lib \
    $(TD_LIBDIR)/TD_AcisBuilder.lib \
    $(TD_LIBDIR)/TD_DynBlocks.lib \
    $(TD_LIBDIR)/TD_Db.lib \
    $(TD_LIBDIR)/TD_DbRoot.lib \
    $(TD_LIBDIR)/TD_Gs.lib \
    $(TD_LIBDIR)/TD_SpatialIndex.lib \
    $(TD_LIBDIR)/TD_Ave.lib \
    $(TD_LIBDIR)/TD_Root.lib \
    $(TD_LIBDIR)/TD_Gi.lib \
    $(TD_LIBDIR)/TD_Ge.lib \
#    $(TD_LIBDIR)/TD_FT.lib \
    $(TD_LIBDIR)/TD_Alloc.lib \
    $(TD_LIBDIR)/RxRasterServices.lib \
    $(TD_LIBDIR)/RecomputeDimBlock.lib \
    $(TD_LIBDIR)/ExFieldEvaluator.lib \
#    $(TD_LIBDIR)/OdBagFiler.lib \
    $(TD_LIBDIR)/RasterProcessor.lib \
    advapi32.lib

The sad conclusion is that once I try to build the plugin I got that error:

   Creating library ogr_DWG.lib and object ogr_DWG.exp
ogrdwgdriver.obj : error LNK2001: unresolved external symbol "private: virtual class OdDbKey * __cdecl OdDbHostAppServices2::key(void)const " (?key at OdDbHostAp
TD_ExamplesCommon.lib(ExHostAppServices.obj) : error LNK2001: unresolved external symbol "private: virtual class OdDbKey * __cdecl OdDbHostAppServices2::key(v
APEAVOdDbKey@@XZ)
ogrdwgdatasource.obj : error LNK2019: unresolved external symbol "class CPLString __cdecl ACTextUnescape(char const *,char const *)" (?ACTextUnescape@@YA?AVCP
ublic: void __cdecl OGRDWGDataSource::ReadLineTypeDefinitions(void)" (?ReadLineTypeDefinitions at OGRDWGDataSource@@QEAAXXZ)
ogrdwglayer.obj : error LNK2001: unresolved external symbol "class CPLString __cdecl ACTextUnescape(char const *,char const *)" (?ACTextUnescape@@YA?AVCPLStri
ogrdwglayer.obj : error LNK2019: unresolved external symbol "unsigned char const * __cdecl ACGetColorTable(void)" (?ACGetColorTable@@YAPEBEXZ) referenced in f
:PrepareLineStyle(class OGRFeature *)" (?PrepareLineStyle at OGRDWGLayer@@AEAAXPEAVOGRFeature@@@Z)
ogrdwg_dimension.obj : error LNK2001: unresolved external symbol "unsigned char const * __cdecl ACGetColorTable(void)" (?ACGetColorTable@@YAPEBEXZ)
ogrdwg_hatch.obj : error LNK2001: unresolved external symbol "unsigned char const * __cdecl ACGetColorTable(void)" (?ACGetColorTable@@YAPEBEXZ)
ogrdwglayer.obj : error LNK2019: unresolved external symbol "void __cdecl ACAdjustText(double,double,class OGRFeature *)" (?ACAdjustText@@YAXNNPEAVOGRFeature@
 OGRFeature * __cdecl OGRDWGLayer::TranslateINSERT(class OdSmartPtr<class OdDbEntity>)" (?TranslateINSERT at OGRDWGLayer@@AEAAPEAVOGRFeature@@V?$OdSmartPtr at VOdDb
ogr_DWG.dll : fatal error LNK1120: 4 unresolved externals

Some of those missing symbol can be found on the source code that comes with the SDK but there is no building project to add them to the missing .lib files, TD_Key.lib, TD_FT.lib or TD_OdBagFiler.lib.

I personally, don't need to build or use the OGR DWG plugin, I am just trying to help a friend. So that was as far as I did.

I also tried to contact the author of that OGR driver but I didn't get a response yet. He probably wrote that driver a long time ago when the SDK as DWGDirect and he might not be able to help now. I understand.

So I hope that exchanging that information with you we can help each other and maybe find a solution for that problem. 

Best regards and good luck.

Ivan


> Date: Tue, 11 Aug 2015 09:17:00 -0700
> From: myoung at pyxisinnovation.com
> To: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] how to build dwg driver?
> 
> Hello Ivan,
> 
> I am running into a similar issue trying to build the DWG driver with the
> latest Teigha libraries. Did you get your issue resolved? If I learn
> anything I will post it here.
> 
> Mark
> 
> 
> 
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-how-to-build-dwg-driver-tp5216555p5219383.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150915/d82a1de7/attachment.html>


More information about the gdal-dev mailing list