I'm trying to build a new functionality that requires loading Matlab's .MAT file and using Matlab libraries. However, I have a linker problem during compilation process.
Code: Select all
[ 45%] Linking CXX executable CloudCompare
Built target QHPR_PLUGIN
[ 47%] Built target QPOISSON_RECON_PLUGIN
[ 54%] Built target QSRA_PLUGIN
[ 56%] Built target QRANSAC_SD_PLUGIN
../CC/libCC_CORE_LIB.so: undefined reference to `matOpen'
collect2: error: ld returned 1 exit status
Code: Select all
# ------------------------------------------------------------------------------
# MATLAB
# ------------------------------------------------------------------------------
find_package ( Matlab REQUIRED )
if( MATLAB_FOUND )
set( MATLAB_ROOT_PATH CACHE PATH "Matlab root directory (i.e. where the 'bin' folder lies)" )
include( ${MATLAB_USE_FILE} )
include_directories(${MATLAB_INCLUDE_DIR})
list( APPEND EXTERNAL_LIBS_INCLUDE_DIR ${MATLAB_INCLUDE_DIR} )
list( APPEND EXTERNAL_LIBS_LIBRARIES ${QT_LIBRARIES} )
else()
message( SEND_ERROR "Matlab required, but not found with 'find_package()'" )
endif()
Code: Select all
CMake Error at CMakeExternalLibs.cmake:105 (message):
Matlab required, but not found with 'find_package()'