potree / PotreeConverter

Create multi res point cloud to use with potree
http://potree.org
BSD 2-Clause "Simplified" License
679 stars 423 forks source link

Error in linking when custom install of GDAL #128

Closed oscarmartinezrubi closed 4 years ago

oscarmartinezrubi commented 9 years ago

Hi,

I have a custom installation of GDAL/liblas in linux (Redhat) and I get this error when compiling (well, using anttiviljami fix, thanks!):

Linking CXX executable PotreeConverter
/home/oscar/sw/liblas/build/lib/liblas.so: undefined reference to `CPLMutexHolder::CPLMutexHolder(void**, double, char const*, int, int)'

I think that is because GDAL is build in a location that the current linking does not know...

A colleague show me how to solve this by adding modifying manually some environmental variables, example:

#!/bin/bash
export LIBLAS_HOME=/home/oscar/sw/liblas/build
export LASZIP_HOME=/home/oscar/sw/laszip-2.1.0/build
export BOOST_HOME=/usr/local
export GDAL_HOME=/home/oscar/sw/gdal-trunk/build

export CWD_HOME=`pwd`
export BOOST_ROOT=$BOOST_HOME

export CMAKE_MODULE_PATH=$LIBLAS_HOME:${CMAKE_MODULE_PATH}
export LD_RUN_PATH=$GDAL_HOME/lib:$BOOST_HOME/lib:$LASZIP_HOME/lib:$LIBLAS_HOME/lib:$CWD_HOME/lib:$LD_RUN_PATH
export LD_LIBRARY_PATH=$GDAL_HOME/lib:$BOOST_HOME/lib:$LASZIP_HOME/lib:$LIBLAS_HOME/lib:$CWD_HOME/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$GDAL_HOME/lib:$BOOST_HOME/lib:$LASZIP_HOME/lib:$LIBLAS_HOME/lib:$CWD_HOME/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$LIBLAS_HOME/include/liblas/capi:${C_INCLUDE_PATH}

export LDFLAGS="${LDFLAGS} -L$GDAL_HOME/lib -L$BOOST_HOME/lib -L$LIBLAS_HOME/lib -L$LASZIP_HOME/lib -llas_c -llaszip"

But I guess some thing could be done within the cmake files to solve for the issue of custom GDAL installations which is not taken into account now...

Regards,

O

oscarmartinezrubi commented 9 years ago

BTW, run this setting of enviromental variables before the cmake

m-schuetz commented 9 years ago

I don't know much about build systems or linux so I'm afraid I can't help with that. :|

hobu commented 8 years ago

CPLMutexHolder::CPLMutexHolder(void**, double, char const*, int, int) is due to GDAL being built in DEBUG mode and this causes the CPLMutex struct to be defined as something other than void*. The only solution at the moment is to build GDAL without --enable-debug.