Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in linking when custom install of GDAL #128

Closed
oscarmartinezrubi opened this issue May 1, 2015 · 3 comments
Closed

Error in linking when custom install of GDAL #128

oscarmartinezrubi opened this issue May 1, 2015 · 3 comments

Comments

@oscarmartinezrubi
Copy link
Contributor

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
Copy link
Contributor Author

BTW, run this setting of enviromental variables before the cmake

@m-schuetz
Copy link
Collaborator

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

@hobu
Copy link

hobu commented Aug 19, 2016

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.

@potree potree closed this as completed Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants