0
votes

i am trying to include pcl library to my qt application project using qmake. I found some similar questions, however none of the answers help to solve my problem.

I have tried to add to the .pro file the paths from pcl lib as well as the 3rd party libraries which are used by pcl. Here is the include lines of my .pro file.

win32:CONFIG(release, debug|release): LIBS += -LD:/Libraries/PCL_1.6.0/lib
win32:CONFIG(release, debug|release): LIBS += -LD:/Libraries/PCL_1.6.0/3rdParty/Eigen/bin
win32:CONFIG(release, debug|release): LIBS += -LD:/Libraries/PCL_1.6.0/3rdParty/Boost/lib

INCLUDEPATH +=  D:/Libraries/PCL_1.6.0/include/pcl-1.6
DEPENDPATH += D:/Libraries/PCL_1.6.0/include/pcl-1.6

INCLUDEPATH +=  D:/Libraries/PCL_1.6.0/3rdParty/Eigen/include
DEPENDPATH += D:/Libraries/PCL_1.6.0/3rdParty/Eigen/include

INCLUDEPATH +=  D:/Libraries/PCL_1.6.0/3rdParty/Boost/include
DEPENDPATH += D:/Libraries/PCL_1.6.0/3rdParty/Boost/include

After that, i am just trying put this include to one of my files:

include pcl/io/pcd_io.h

And these are the errors i am getting back:

D:\Libraries\PCL_1.6.0\3rdParty\Eigen\include\Eigen\src\Core\products\GeneralBlockPanelKernel.h:604: error: unable to find string literal operator 'operator""X' with 'const char [2]', 'long long unsigned int' arguments EIGEN_ASM_COMMENT("mybegin2");

D:\Libraries\PCL_1.6.0\3rdParty\Eigen\include\Eigen\src\Core\products\GeneralBlockPanelKernel.h:640: error: unable to find string literal operator 'operator""X' with 'const char [2]', 'long long unsigned int' arguments EIGEN_ASM_COMMENT("myend");

D:\Libraries\PCL_1.6.0\3rdParty\Eigen\include\Eigen\src\Core\products\GeneralBlockPanelKernel.h:644: error: unable to find string literal operator 'operator""X' with 'const char [2]', 'long long unsigned int' arguments EIGEN_ASM_COMMENT("mybegin4");

Can you please help me to solve the problem?

1

1 Answers

2
votes

I suggest to use CMake. See the links below:

The CMakeList.txt is as follows:

cmake_minimum_required(VERSION 2.8.11)

project(pcl_visualizer)

# init_qt: Let's do the CMake job for us
set(CMAKE_AUTOMOC ON) # For meta object compiler
set(CMAKE_AUTORCC ON) # Resource files
set(CMAKE_AUTOUIC ON) # UI files

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Find the QtWidgets library
find_package(Qt5 REQUIRED Widgets)

find_package(VTK REQUIRED)
find_package(PCL 1.7.1 REQUIRED)

# Fix a compilation bug under ubuntu 16.04 (Xenial)
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

include_directories(${PCL_INCLUDE_DIRS})
add_definitions(${PCL_DEFINITIONS})

set(project_SOURCES main.cpp pclviewer.cpp)

add_executable(${PROJECT_NAME} ${project_SOURCES})

target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES} Qt5::Widgets)

Hope it will help you.