QGIS 2.4 compilation error on Redhat 6.2

153 views Asked by At

I try to compil QGIS 2.4 from scratch (aka source) on a Redhat 6.2 server (please don't ask me why...).

I have installed all the pre-requisites, applied the patch 0001-Fix-build-failure-with-gcc-4.4-bug-10762.patch (following this: https://hub.qgis.org/attachments/7755/0001-Fix-build-failure-with-gcc-4.4-bug-10762.patch) and configure QGis using the INSTALL file:

mkdir build-master
ccmake ..
<configure>
make

Unfortunatly, i have the following

$ make
[  0%] Built target version
Linking CXX shared library ../../output/lib/libqgis_core.so
CMakeFiles/qgis_core.dir/qgsgml.cpp.o: In function `QgsGml::getFeatures(QString const&, QGis::WkbType*, QgsRectangle*, QString const&, QString const&)':
qgsgml.cpp:(.text+0x9d8): undefined reference to `XML_ParserCreateNS'
qgsgml.cpp:(.text+0x9f2): undefined reference to `XML_SetUserData'
qgsgml.cpp:(.text+0xa0f): undefined reference to `XML_SetElementHandler'
qgsgml.cpp:(.text+0xa25): undefined reference to `XML_SetCharacterDataHandler'
qgsgml.cpp:(.text+0x11fd): undefined reference to `XML_Parse'
qgsgml.cpp:(.text+0x1216): undefined reference to `XML_GetErrorCode'
qgsgml.cpp:(.text+0x1251): undefined reference to `XML_GetCurrentColumnNumber'
qgsgml.cpp:(.text+0x128c): undefined reference to `XML_GetCurrentLineNumber'
qgsgml.cpp:(.text+0x12c5): undefined reference to `XML_ErrorString'
qgsgml.cpp:(.text+0x179a): undefined reference to `XML_ParserFree'
CMakeFiles/qgis_core.dir/qgsgml.cpp.o: In function `QgsGml::getFeatures(QByteArray const&, QGis::WkbType*, QgsRectangle*)':
qgsgml.cpp:(.text+0x18ac): undefined reference to `XML_ParserCreateNS'
qgsgml.cpp:(.text+0x18c3): undefined reference to `XML_SetUserData'
qgsgml.cpp:(.text+0x18e0): undefined reference to `XML_SetElementHandler'
qgsgml.cpp:(.text+0x18f6): undefined reference to `XML_SetCharacterDataHandler'
qgsgml.cpp:(.text+0x1932): undefined reference to `XML_Parse'
CMakeFiles/qgis_core.dir/qgsgmlschema.cpp.o: In function `QgsGmlSchema::guessSchema(QByteArray const&)':
qgsgmlschema.cpp:(.text+0x3452): undefined reference to `XML_ParserCreateNS'
qgsgmlschema.cpp:(.text+0x346c): undefined reference to `XML_SetUserData'
qgsgmlschema.cpp:(.text+0x3489): undefined reference to `XML_SetElementHandler'
qgsgmlschema.cpp:(.text+0x349f): undefined reference to `XML_SetCharacterDataHandler'
qgsgmlschema.cpp:(.text+0x34e1): undefined reference to `XML_Parse'
qgsgmlschema.cpp:(.text+0x34fa): undefined reference to `XML_GetErrorCode'
qgsgmlschema.cpp:(.text+0x3501): undefined reference to `XML_ErrorString'
collect2: ld returned 1 exit status
make[2]: *** [output/lib/libqgis_core.so.2.4.0] Error 1
make[1]: *** [src/core/CMakeFiles/qgis_core.dir/all] Error 2
make: *** [all] Error 2

Looks like it did not found the Expat lib insatlled in /usr/local:

$ ll /usr/local/include/expat*
-rw-r--r--. 1 root root  3364 Jun 15 10:21 /usr/local/include/expat_external.h
-rw-r--r--. 1 root root 41752 Jun 15 10:21 /usr/local/include/expat.h
$ ll /usr/local/lib/libexpat.*
-rw-r--r--. 1 root root 711896 Jun 15 10:21 /usr/local/lib/libexpat.a
-rwxr-xr-x. 1 root root    942 Jun 15 10:21 /usr/local/lib/libexpat.la
lrwxrwxrwx. 1 root root     17 Jun 15 10:21 /usr/local/lib/libexpat.so -> libexpat.so.1.6.0
lrwxrwxrwx. 1 root root     17 Jun 15 10:21 /usr/local/lib/libexpat.so.1 -> libexpat.so.1.6.0
-rwxr-xr-x. 1 root root 440095 Jun 15 10:21 /usr/local/lib/libexpat.so.1.6.0

Any idea ?

Thanks in advance.

1

There are 1 answers

0
Nicolargo On

Found a work arround.

The expat lib is not included during the compil.

cd build-master
find src/ -name link.txt | xargs -0 sed -i '' -e 's/\-lsqlite3/\-lsqlite3\ \-lexpat/g'
make