Привет всем
Я решил использовать VsCode для написания кода на C ++ с использованием PCL (библиотеки облаков точек). Я правильно установил PCL и зависимые от него библиотеки (Boost, VTK, Eigen, FLANN, ...) в Ubuntu 16.04. Я протестировал эти библиотеки в code :: blocks, и они были в порядке! Теперь я пытаюсь настроить эти библиотеки на VsCode. После борьбы с задачами. json и c_cpp_properties. json у меня все еще есть 2 проблемы при настройке VsCode. 1. Пути к библиотекам (например, pcl, VTK, ...) в main. cpp необходимо адресовать из "pcl-1.9 / pcl / ...", но мне нужно обращаться к ним из "pcl / ..." , потому что другие пути в этих библиотеках адресуются таким образом. (img1, строка 24) 2. Библиотечные пути выполняются относительно $ {workspaceFolder}. как я могу заставить их исполниться абсолютным образом? (img2, проблемы)
в следующих используемых задачах. json и c_cpp_properties. json прилагаются. c_cpp_properties. json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"/usr/local/include/boost/**",
"/usr/include/eigen3/**",
"/usr/local/include/flann/**",
"/usr/local/include/vtk-8.1/**",
"/usr/local/include/pcl-1.9/pcl/**",
"/usr/local/include/pcl-1.9"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "gcc-x64",
"compilerArgs": [
"-lvtkverdict-8.1",
"-lpcl_common",
"-lpcl_ml",
"-lpcl_kdtree",
"-lpcl_octree",
"-lpcl_search",
"-lpcl_sample_consensus",
"-lpcl_filters",
"-lpcl_io",
"-lpcl_features",
"-lpcl_segmentation",
"-lpcl_visualization",
"-lpcl_surface",
"-lpcl_registration",
"-lpcl_keypoints",
"-lpcl_tracking",
"-lpcl_recognition",
"-lpcl_stereo",
"-lpcl_outofcore",
"-lpcl_people",
"/usr/local/lib/libboost_system.so.1.65.0",
"/usr/local/lib/libboost_filesystem.so.1.65.0",
"/usr/local/lib/libboost_thread.so.1.65.0",
"/usr/local/lib/libboost_date_time.so.1.65.0",
"/usr/local/lib/libboost_iostreams.so.1.65.0",
"/usr/local/lib/libboost_serialization.so.1.65.0",
"/usr/local/lib/libboost_chrono.so.1.65.0",
"/usr/lib/x86_64-linux-gnu/libpthread.so",
"/usr/lib/x86_64-linux-gnu/libqhull.so",
"/usr/lib/x86_64-linux-gnu/libqhull.so",
"/usr/lib/libOpenNI.so",
"/usr/lib/libOpenNI2.so",
"-lflann",
"-lflann_cpp",
"-lvtksys-8.1",
"-lvtkCommonCore-8.1",
"-lvtkCommonMath-8.1",
"-lvtkCommonMisc-8.1",
"-lvtkCommonSystem-8.1",
"-lvtkCommonTransforms-8.1",
"-lvtkCommonDataModel-8.1",
"-lvtkCommonColor-8.1",
"-lvtkCommonExecutionModel-8.1",
"-lvtkCommonComputationalGeometry-8.1",
"-lvtkFiltersCore-8.1",
"-lvtkFiltersGeneral-8.1",
"-lvtkImagingCore-8.1",
"-lvtkImagingFourier-8.1",
"-lvtkalglib-8.1",
"-lvtkFiltersStatistics-8.1",
"-lvtkFiltersExtraction-8.1",
"-lvtkInfovisCore-8.1",
"-lvtkFiltersGeometry-8.1",
"-lvtkFiltersSources-8.1",
"-lvtkRenderingCore-8.1",
"-lvtkzlib-8.1",
"-lvtkfreetype-8.1",
"-lvtkRenderingFreeType-8.1",
"-lvtkRenderingContext2D-8.1",
"-lvtkChartsCore-8.1",
"-lvtkDICOMParser-8.1",
"-lvtklz4-8.1",
"-lvtkIOCore-8.1",
"-lvtkIOLegacy-8.1",
"-lvtkexpat-8.1",
"-lvtkIOXMLParser-8.1",
"-lvtkDomainsChemistry-8.1",
"-lvtkglew-8.1",
"-lvtkRenderingOpenGL2-8.1",
"-lvtkDomainsChemistryOpenGL2-8.1",
"-lvtkIOXML-8.1",
"-lvtkParallelCore-8.1",
"-lvtkFiltersAMR-8.1",
"-lvtkFiltersFlowPaths-8.1",
"-lvtkFiltersGeneric-8.1",
"-lvtkImagingSources-8.1",
"-lvtkFiltersHybrid-8.1",
"-lvtkFiltersHyperTree-8.1",
"-lvtkImagingGeneral-8.1",
"-lvtkFiltersImaging-8.1",
"-lvtkFiltersModeling-8.1",
"-lvtkFiltersParallel-8.1",
"-lvtkFiltersParallelImaging-8.1",
"-lvtkFiltersPoints-8.1",
"-lvtkFiltersProgrammable-8.1",
"-lvtkFiltersSMP-8.1",
"-lvtkFiltersSelection-8.1",
"-lvtkFiltersTexture-8.1",
"-lvtkFiltersTopology-8.1",
"-lvtkFiltersVerdict-8.1",
"-lvtkmetaio-8.1",
"-lvtkjpeg-8.1",
"-lvtkpng-8.1",
"-lvtktiff-8.1",
"-lvtkIOImage-8.1",
"-lvtkImagingHybrid-8.1",
"-lvtkInfovisLayout-8.1",
"-lvtkInteractionStyle-8.1",
"-lvtkImagingColor-8.1",
"-lvtkRenderingAnnotation-8.1",
"-lvtkRenderingVolume-8.1",
"-lvtkInteractionWidgets-8.1",
"-lvtkViewsCore-8.1",
"-lvtkproj4-8.1",
"-lvtkGeovisCore-8.1",
"-lvtkhdf5_hl-8.1",
"-lvtkhdf5-8.1",
"-lvtkIOAMR-8.1",
"-lvtkIOEnSight-8.1",
"-lvtkNetCDF-8.1",
"-lvtkexoIIc-8.1",
"-lvtkIOExodus-8.1",
"-lvtkgl2ps-8.1",
"-lvtkRenderingGL2PSOpenGL2-8.1",
"-lvtklibharu-8.1",
"-lvtkIOExport-8.1",
"-lvtkIOExportOpenGL2-8.1",
"-lvtkIOGeometry-8.1",
"-lvtkIOImport-8.1",
"-lvtklibxml2-8.1",
"-lvtkIOInfovis-8.1",
"-lvtkIOLSDyna-8.1",
"-lvtkIOMINC-8.1",
"-lvtkoggtheora-8.1",
"-lvtkIOMovie-8.1",
"-lvtknetcdfcpp-8.1",
"-lvtkIONetCDF-8.1",
"-lvtkIOPLY-8.1",
"-lvtkjsoncpp-8.1",
"-lvtkIOParallel-8.1",
"-lvtkIOParallelXML-8.1",
"-lvtksqlite-8.1",
"-lvtkIOSQL-8.1",
"-lvtkIOTecplotTable-8.1",
"-lvtkIOVideo-8.1",
"-lvtkImagingMath-8.1",
"-lvtkImagingMorphological-8.1",
"-lvtkImagingStatistics-8.1",
"-lvtkImagingStencil-8.1",
"-lvtkInteractionImage-8.1",
"-lvtkRenderingContextOpenGL2-8.1",
"-lvtkRenderingImage-8.1",
"-lvtkRenderingLOD-8.1",
"-lvtkRenderingLabel-8.1",
"-lvtkRenderingVolumeOpenGL2-8.1",
"-lvtkViewsContext2D-8.1",
"-lvtkViewsInfovis-8.1"
],
"browse": {
"path": [
"/usr/local/include/boost",
"/usr/include/eigen3",
"/usr/local/include/flann",
"/usr/local/include/vtk-8.1",
"/usr/local/include/pcl-1.9/pcl",
"/usr/local/include/pcl-1.9"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}
задач. json {
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++ build active file",
"linux": {
"command": "/usr/bin/g++"
},
"args": [
"-g",
"-std=c++0x",
"-I/usr/local/include/pcl-1.9/pcl",
"-I/usr/include/eigen3",
"-I/usr/local/include/vtk-8.1",
"-I/usr/local/include/boost",
"-I/usr/local/include/flann",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-lvtkverdict-8.1",
"-lpcl_common",
"-lpcl_ml",
"-lpcl_kdtree",
"-lpcl_octree",
"-lpcl_search",
"-lpcl_sample_consensus",
"-lpcl_filters",
"-lpcl_io",
"-lpcl_features",
"-lpcl_segmentation",
"-lpcl_visualization",
"-lpcl_surface",
"-lpcl_registration",
"-lpcl_keypoints",
"-lpcl_tracking",
"-lpcl_recognition",
"-lpcl_stereo",
"-lpcl_outofcore",
"-lpcl_people",
"/usr/local/lib/libboost_system.so.1.65.0",
"/usr/local/lib/libboost_filesystem.so.1.65.0",
"/usr/local/lib/libboost_thread.so.1.65.0",
"/usr/local/lib/libboost_date_time.so.1.65.0",
"/usr/local/lib/libboost_iostreams.so.1.65.0",
"/usr/local/lib/libboost_serialization.so.1.65.0",
"/usr/local/lib/libboost_chrono.so.1.65.0",
"/usr/lib/x86_64-linux-gnu/libpthread.so",
"/usr/lib/x86_64-linux-gnu/libqhull.so",
"/usr/lib/x86_64-linux-gnu/libqhull.so",
"/usr/lib/libOpenNI.so",
"/usr/lib/libOpenNI2.so",
"-lflann",
"-lflann_cpp",
"-lvtksys-8.1",
"-lvtkCommonCore-8.1",
"-lvtkCommonMath-8.1",
"-lvtkCommonMisc-8.1",
"-lvtkCommonSystem-8.1",
"-lvtkCommonTransforms-8.1",
"-lvtkCommonDataModel-8.1",
"-lvtkCommonColor-8.1",
"-lvtkCommonExecutionModel-8.1",
"-lvtkCommonComputationalGeometry-8.1",
"-lvtkFiltersCore-8.1",
"-lvtkFiltersGeneral-8.1",
"-lvtkImagingCore-8.1",
"-lvtkImagingFourier-8.1",
"-lvtkalglib-8.1",
"-lvtkFiltersStatistics-8.1",
"-lvtkFiltersExtraction-8.1",
"-lvtkInfovisCore-8.1",
"-lvtkFiltersGeometry-8.1",
"-lvtkFiltersSources-8.1",
"-lvtkRenderingCore-8.1",
"-lvtkzlib-8.1",
"-lvtkfreetype-8.1",
"-lvtkRenderingFreeType-8.1",
"-lvtkRenderingContext2D-8.1",
"-lvtkChartsCore-8.1",
"-lvtkDICOMParser-8.1",
"-lvtklz4-8.1",
"-lvtkIOCore-8.1",
"-lvtkIOLegacy-8.1",
"-lvtkexpat-8.1",
"-lvtkIOXMLParser-8.1",
"-lvtkDomainsChemistry-8.1",
"-lvtkglew-8.1",
"-lvtkRenderingOpenGL2-8.1",
"-lvtkDomainsChemistryOpenGL2-8.1",
"-lvtkIOXML-8.1",
"-lvtkParallelCore-8.1",
"-lvtkFiltersAMR-8.1",
"-lvtkFiltersFlowPaths-8.1",
"-lvtkFiltersGeneric-8.1",
"-lvtkImagingSources-8.1",
"-lvtkFiltersHybrid-8.1",
"-lvtkFiltersHyperTree-8.1",
"-lvtkImagingGeneral-8.1",
"-lvtkFiltersImaging-8.1",
"-lvtkFiltersModeling-8.1",
"-lvtkFiltersParallel-8.1",
"-lvtkFiltersParallelImaging-8.1",
"-lvtkFiltersPoints-8.1",
"-lvtkFiltersProgrammable-8.1",
"-lvtkFiltersSMP-8.1",
"-lvtkFiltersSelection-8.1",
"-lvtkFiltersTexture-8.1",
"-lvtkFiltersTopology-8.1",
"-lvtkFiltersVerdict-8.1",
"-lvtkmetaio-8.1",
"-lvtkjpeg-8.1",
"-lvtkpng-8.1",
"-lvtktiff-8.1",
"-lvtkIOImage-8.1",
"-lvtkImagingHybrid-8.1",
"-lvtkInfovisLayout-8.1",
"-lvtkInteractionStyle-8.1",
"-lvtkImagingColor-8.1",
"-lvtkRenderingAnnotation-8.1",
"-lvtkRenderingVolume-8.1",
"-lvtkInteractionWidgets-8.1",
"-lvtkViewsCore-8.1",
"-lvtkproj4-8.1",
"-lvtkGeovisCore-8.1",
"-lvtkhdf5_hl-8.1",
"-lvtkhdf5-8.1",
"-lvtkIOAMR-8.1",
"-lvtkIOEnSight-8.1",
"-lvtkNetCDF-8.1",
"-lvtkexoIIc-8.1",
"-lvtkIOExodus-8.1",
"-lvtkgl2ps-8.1",
"-lvtkRenderingGL2PSOpenGL2-8.1",
"-lvtklibharu-8.1",
"-lvtkIOExport-8.1",
"-lvtkIOExportOpenGL2-8.1",
"-lvtkIOGeometry-8.1",
"-lvtkIOImport-8.1",
"-lvtklibxml2-8.1",
"-lvtkIOInfovis-8.1",
"-lvtkIOLSDyna-8.1",
"-lvtkIOMINC-8.1",
"-lvtkoggtheora-8.1",
"-lvtkIOMovie-8.1",
"-lvtknetcdfcpp-8.1",
"-lvtkIONetCDF-8.1",
"-lvtkIOPLY-8.1",
"-lvtkjsoncpp-8.1",
"-lvtkIOParallel-8.1",
"-lvtkIOParallelXML-8.1",
"-lvtksqlite-8.1",
"-lvtkIOSQL-8.1",
"-lvtkIOTecplotTable-8.1",
"-lvtkIOVideo-8.1",
"-lvtkImagingMath-8.1",
"-lvtkImagingMorphological-8.1",
"-lvtkImagingStatistics-8.1",
"-lvtkImagingStencil-8.1",
"-lvtkInteractionImage-8.1",
"-lvtkRenderingContextOpenGL2-8.1",
"-lvtkRenderingImage-8.1",
"-lvtkRenderingLOD-8.1",
"-lvtkRenderingLabel-8.1",
"-lvtkRenderingVolumeOpenGL2-8.1",
"-lvtkViewsContext2D-8.1",
"-lvtkViewsInfovis-8.1"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "test",
"isDefault": true
}
},
]
}
img1- VsCode Error и включают пути img2- проблема