Hello,

I was wondering if you could help with a problem I encountered when building GDAL with the Open Design Alliance Libraries (ODA >= 2021) on Linux.

I've been trying to build GDAL with ODA version 2021.2 based on the changes made to build on Windows in the following commit <https://github.com/OSGeo/gdal/commit/44ce5be4c043eea2fb2bc719858fb62285a5cc03>.

Following those changes I've edited the configure and dwg's GNUmakefile as seen in the attached diff. However I've run into a linking problem that I haven't been able to solve. Namely when building the 'gdalinfo' target I'm getting several 'undefined reference' errors with the built libgdal.so:

...

/bin/bash /home/paulo/Dev/gdal/gdal/libtool --mode=link --silent g++  gdalinfo_bin.lo  /home/paulo/Dev/gdal/gdal/libgdal.la  -o gdalinfo /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `OdDgHostAppServices::program()' /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `pcre_study' /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `OdDgFontTable::getFont(unsigned int) const' /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `OdDgDatabase::getNamedViewTable(OdDg::OpenMode) const' /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `OdDgGraphicsElementPE::desc()' /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `OdDgElement::elementId() const' /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `OdDgArc2d::desc()' /home/paulo/Dev/gdal/gdal/.libs/libgdal.so: undefined reference to `OdDgHostAppServices::getThumbnail(OdString const&, OdBinaryData&)'

...

collect2: error: ld returned 1 exit status
GNUmakefile:90: recipe for target 'gdalinfo' failed
make[1]: *** [gdalinfo] Error 1


The configure command used for this build was the following:

./configure --with-python=python3 --with-proj=/usr/local --with-pg=yes --with-teigha=/home/paulo/Dev/oda/21.2/Drawings_lnxX64_7.2dll --with-teigha-krl=/home/paulo/Dev/oda/21.2/Kernel_lnxX64_7.2dll --with-teigha-plt=lnxX64_7.2dll

If you could give some insights about this problem it would be greatly appreciated.

Regards
diff --git a/gdal/configure b/gdal/configure
index 19524331b8..68d9fa9af5 100755
--- a/gdal/configure
+++ b/gdal/configure
@@ -704,6 +704,7 @@ HAVE_IDB
 TEIGHA_CPPFLAGS
 HAVE_TEIGHA
 TEIGHA_DIR
+TEIGHA_KRL_DIR
 HAVE_PCRE
 RASTERLITE2_CFLAGS
 HAVE_RASTERLITE2
@@ -1191,6 +1192,7 @@ with_sqlite3
 with_rasterlite2
 with_pcre
 with_teigha
+with_teigha_krl
 with_teigha_plt
 with_idb
 with_sde
@@ -38204,6 +38206,7 @@ fi
 
 
 TEIGHA_DIR=
+TEIGHA_KRL_DIR=
 TEIGHA_CPPFLAGS=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for Teigha" >&5
@@ -38231,17 +38234,21 @@ fi
 
     if test "x$with_teigha_plt" != "x" ; then
         TEIGHA_DIR=$with_teigha
+        TEIGHA_KRL_DIR=$with_teigha_krl
         HAVE_TEIGHA=yes
         TEIGHA_PLT=$with_teigha_plt
         LIBS="${LIBS} ${TEIGHA_DIR}/bin/${TEIGHA_PLT}/TG_Db.tx"
+        LIBS="${LIBS} ${TEIGHA_DIR}/bin/${TEIGHA_PLT}/TD_DbEntities.tx"
+        LIBS="${LIBS} ${TEIGHA_DIR}/lib/${TEIGHA_PLT}/libTD_DrawingsExamplesCommon.a"
         LIBS="${LIBS} ${TEIGHA_DIR}/lib/${TEIGHA_PLT}/libTG_ExamplesCommon.a"
-        LIBS="${LIBS} ${TEIGHA_DIR}/lib/${TEIGHA_PLT}/libTD_ExamplesCommon.a"
+        LIBS="${LIBS} ${TEIGHA_KRL_DIR}/lib/${TEIGHA_PLT}/libTD_ExamplesCommon.a"
         LIBS="${LIBS} ${TEIGHA_DIR}/lib/${TEIGHA_PLT}/libTD_Key.a"
         LIBS="${LIBS} -L${TEIGHA_DIR}/bin/${TEIGHA_PLT} -lTD_Db"
-        LIBS="${LIBS} -L${TEIGHA_DIR}/bin/${TEIGHA_PLT} -lTD_DbRoot"
-        LIBS="${LIBS} -L${TEIGHA_DIR}/bin/${TEIGHA_PLT} -lTD_Root"
-        LIBS="${LIBS} -L${TEIGHA_DIR}/bin/${TEIGHA_PLT} -lTD_Ge"
-        LIBS="${LIBS} -L${TEIGHA_DIR}/bin/${TEIGHA_PLT} -lTD_Alloc"
+        LIBS="${LIBS} -L${TEIGHA_DIR}/bin/${TEIGHA_PLT} -lTD_DbCore"
+        LIBS="${LIBS} -L${TEIGHA_KRL_DIR}/bin/${TEIGHA_PLT} -lTD_DbRoot"
+        LIBS="${LIBS} -L${TEIGHA_KRL_DIR}/bin/${TEIGHA_PLT} -lTD_Root"
+        LIBS="${LIBS} -L${TEIGHA_KRL_DIR}/bin/${TEIGHA_PLT} -lTD_Ge"
+        LIBS="${LIBS} -L${TEIGHA_KRL_DIR}/bin/${TEIGHA_PLT} -lTD_Alloc"
         if test -f "${TEIGHA_DIR}/bin/${TEIGHA_PLT}/libTD_Db.so"; then
             TEIGHA_CPPFLAGS="-D_TOOLKIT_IN_DLL_"
         fi
diff --git a/gdal/ogr/ogrsf_frmts/dwg/GNUmakefile b/gdal/ogr/ogrsf_frmts/dwg/GNUmakefile
index fe2870f97e..bd68b2d146 100644
--- a/gdal/ogr/ogrsf_frmts/dwg/GNUmakefile
+++ b/gdal/ogr/ogrsf_frmts/dwg/GNUmakefile
@@ -1,8 +1,11 @@
 
 TDXXFLAGS = \
-	-I$(TEIGHA_DIR)/Core/Include \
-	-I$(TEIGHA_DIR)/Core/Extensions/ExServices \
-	-I$(TEIGHA_DIR)/Core/Examples/Common \
+	-I$(TEIGHA_DIR)/ThirdParty/activation \
+	-I$(TEIGHA_DIR)/KernelBase/Include \
+	-I$(TEIGHA_DIR)/Kernel/Include \
+	-I$(TEIGHA_DIR)/Kernel/Extensions/ExServices \
+	-I$(TEIGHA_DIR)/Drawing/Include \
+	-I$(TEIGHA_DIR)/Drawing/Extensions/ExServices \
 	-I$(TEIGHA_DIR)/Dgn/include \
 	-I$(TEIGHA_DIR)/Dgn/Extensions/ExServices
 
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to