CGAL:对 _createImage 的未定义引用
Posted
技术标签:
【中文标题】CGAL:对 _createImage 的未定义引用【英文标题】:CGAL: undefined reference to _createImage 【发布时间】:2018-01-14 12:21:46 【问题描述】:我得到了对 `_createImage(int, int, int, int, float,float,float,int,WORD_KIND,SIGN)',当我尝试参与 代码来自: https://doc.cgal.org/latest/Mesh_3/Mesh_3_2random_labeled_image_8h-example.html
基本上我要做的是将 ITK 图像转换为 CGAL image_3,为此我需要用我自己的数据初始化 image_3,但它给了我对 _create_image 的未定义引用。我添加了 ImageIO 和 Image_3 的标头
const int dim = 400;
_image* image = _createImage(dim, dim, dim, 1,
1.f, 1.f, 1.f, 1,
WK_FIXED, SGN_UNSIGNED);
Cmakelist.txt
find_package(CGAL QUIET)
if( CGAL_FOUND)
include_directories("/usr/local/include")
message(STATUS "CGAL status:")
message(STATUS " libraries: $CGAL_LIB")
message(STATUS " include path: $CGAL_INCLUDE_DIRS")
endif(CGAL_FOUND)
target_link_libraries(main meshlib iolib $ITK_LIBRARIES $CGAL_LIB )
标志
set(CMAKE_CXX_FLAGS "$CMAKE_CXX_FLAGS -std=c++11 -Wall -Wall -g -Wextra -Wno-sign-compare -pthread -ltbb -lpthread -lCGAL -lCGAL_Core -lCGAL_ImageIO -lmpfr -lgmp -frounding-math ")
失败:
libmeshlib.a(volumetric-image.cpp.o):在函数中
VolumetricImage::ItkImageToCgalImage(itk::SmartPointer<itk::Image<char, 3u> >&, CGAL::Image_3&)': /home/n/Documents/b1/b1/src/volumetric-image.cpp:217: undefined reference to
_createImage(int,int,int,int,float,float, float, int, WORD_KIND, SIGN)' libmeshlib.a(volumetric-image.cpp.o): 在 函数CGAL::Image_3::Image_3(point_image*)': /usr/local/include/CGAL/Image_3.h:105: undefined reference to
CGAL::Image_3::private_read(point_image*)' collect2: error: ld 返回 1 退出状态 src/CMakeFiles/main.dir/build.make:419: recipe 对于目标 'src/main' 失败 make[2]: * [src/main] 错误 1 make[2]: 离开目录'/home/noega/Documents/b1/b1/build' CMakeFiles/Makefile2:896:目标配方 'src/CMakeFiles/main.dir/all' 失败 make[1]: * [src/CMakeFiles/main.dir/all] 错误 2 make[1]: 离开目录 '/home/n/Documents/b1/b1/build' Makefile:83: 配方 目标 'all' 失败 make: *** [all] 错误 2
方法
void VolumetricImage::ItkImageToCgalImage(itk::Image<char, 3>::Pointer &in_volumetric_image, CGAL::Image_3 &out_image)
typedef itk::Image< char, 3 > image_type;
image_type::RegionType region = in_volumetric_image->GetLargestPossibleRegion();
image_type::SizeType size = region.GetSize();
image_type::SpacingType voxel_size = in_volumetric_image->GetSpacing();
_image* im = _createImage(size[0], size[1], size[2], 1,
voxel_size[0], voxel_size[1], voxel_size[2],
1, WK_FIXED, SGN_SIGNED);
CGAL::Image_3 image(im);
编辑 2:
92%] 链接 CXX 可执行主 cd /home/n/Documents/b1/b1/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=1 /usr/bin/c++ -std=c++11 -Wall -Wall -g -Wextra -Wno-sign-compare -pthread -ltbb -lpthread -lCGAL -lCGAL_Core -lCGAL_ImageIO -lmpfr -lgmp -frounding-math
编辑 3:
[ 92%] 链接 CXX 可执行主 cd /home/n/Documents/b1/b1/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=1 /usr/bin/c++ -std=c++11 -Wall -Wall -g -Wextra -Wno-sign-compare -pthread -ltbb -lpthread -lCGAL -lCGAL_Core -lCGAL_ImageIO -lmpfr -lgmp -frounding-math CMakeFiles/main.dir/main.cpp.o -o main -rdynamic libmeshlib.a libiolib.a /usr/local/lib/libitkdouble -conversion-4.12.a /usr/local/lib/libitksys-4.12.a /usr/local/lib/libitkvnl_algo-4.12.a /usr/local/lib/libitkvnl-4.12.a /usr/local/lib/libitkv3p_netlib-4.12.a /usr/local/lib/libitknetlib-4.12.a /usr/local/lib/libitkvcl-4.12.a /usr/local/lib/libITKCommon-4.12.a /usr/local/lib/libitkNetlibSlatec-4.12.a /usr/local/lib/libITKStatistics-4.12.a /usr/local/lib/libITKTransform-4.12.a /usr/local/lib/libITKIOImageBase-4.12.a /usr/local/lib/libITKIOBMP-4.12.a /usr/local/lib/libITKEXPAT-4.12.a /usr/local/lib/libitkzlib-4.12.a /usr/local/lib/libitkgdcmDICT-4.12.a /usr/local/lib/libitkgdcmMSFF-4.12.a /usr/local/lib/libITKIOGDCM-4.12.a /usr/local/lib/libITKIOGIPL-4.12.a /usr/local/lib/libitkjpeg-4.12.a /usr/local/lib/libITKIOJPEG-4.12.a /usr/local/lib/libITKMetaIO-4.12.a /usr/local/lib/libITKIOMeta-4.12.a /usr/local/lib/libITKznz-4.12.a /usr/local/lib/libITKniftiio-4.12.a /usr/local/lib/libITKIONIFTI-4.12.a /usr/local/lib/libITKNrrdIO-4.12.a /usr/local/lib/libITKIONRRD-4.12.a /usr/local/lib/libitkpng-4.12.a /usr/local/lib/libITKIOPNG-4.12.a /usr/local/lib/libitktiff-4.12.a /usr/local/lib/libITKIOTIFF-4.12.a /usr/local/lib/libITKIOVTK-4.12.a /usr/local/lib/libITKLabelMap-4.12.a /usr/local/lib/libITKMesh-4.12.a /usr/local/lib/libITKSpatialObjects-4.12.a /usr/local/lib/libITKPath-4.12.a /usr/local/lib/libITKQuadEdgeMesh-4.12.a /usr/local/lib/libITKOptimizers-4.12.a /usr/local/lib/libITKPolynomials-4.12.a /usr/local/lib/libITKBiasCorrection-4.12.a /usr/local/lib/libITKBioCell-4.12.a /usr/local/lib/libITKDICOMParser-4.12.a /usr/local/lib/libITKIOXML-4.12.a /usr/local/lib/libITKiospatialObjects-4.12.a /usr/local/lib/libITKFEM-4.12.a /usr/local/lib/libITKgiftiio-4.12.a /usr/local/lib/libITKIOMesh-4.12.a /usr/local/lib/libitkhdf5_cpp.a /usr/local/lib/libitkhdf5.a /usr/local/lib/libITKIOBioRad-4.12.a /usr/local/lib/libITKIOCSV-4.12.a /usr/local/lib/libITKIOIPL-4.12.a /usr/local/lib/libITKIOGE-4.12.a /usr/local/lib/libITKIOSiemens-4.12.a /usr/local/lib/libITKIOHDF5-4.12.a /usr/local/lib/libITKIOLSM-4.12.a /usr/local/lib/libITKIOMRC-4.12.a /usr/local/lib/libITKIOstimulate-4.12.a /usr/local/lib/libITKTransformFactory-4.12.a /usr/local/lib/libITKIOTransformBase-4.12.a /usr/local/lib/libITKIOTransformHDF5-4.12.a /usr/local/lib/libITKIOTransformInsightLegacy-4.12.a /usr/local/lib/libITKIOTransformMatlab-4.12.a /usr/local/lib/libITKKLMRegionGrowing-4.12.a /usr/local/lib/libITKVTK-4.12.a /usr/local/lib/libITKWatersheds-4.12.a /usr/local/lib/libITKOptimizersv4-4.12.a /usr/local/lib/libITKVideoCore-4.12.a /usr/local/lib/libITKVideoIO-4.12.a -lCGAL /usr/local/lib/libvtkzlib-8.0.a /usr/local/lib/libvtkFiltersImaging-8.0.a /usr/local/lib/libvtkCommonCore-8.0.a /usr/local/lib/libvtksys-8.0.a /usr/local/lib/libvtkCommonDataModel-8.0.a /usr/local/lib/libvtkCommonMath-8.0.a /usr/local/lib/libvtkCommonMisc-8.0.a /usr/local/lib/libvtkCommonSystem-8.0.a /usr/local/lib/libvtkCommonTransforms-8.0.a /usr/local/lib/libvtkCommonExecutionModel-8.0.a /usr/local/lib/libvtkFiltersStatistics-8.0.a /usr/local/lib/libvtkImagingFourier-8.0.a /usr/local/lib/libvtkImagingCore-8.0.a /usr/local/lib/libvtkalglib-8.0.a /usr/local/lib/libvtkImagingGeneral-8.0.a /usr/local/lib/libvtkImagingSources-8.0.a /usr/local/lib/libvtkFiltersFlowPaths-8.0.a /usr/local/lib/libvtkFiltersCore-8.0.a /usr/local/lib/libvtkFiltersGeometry-8.0.a /usr/local/lib/libvtkFiltersSources-8.0.a /usr/local/lib/libvtkCommonComputationalGeometry-8.0.a /usr/local/lib/libvtkFiltersGeneral-8.0.a /usr/local/lib/libvtkIOCore-8.0.a /usr/local/lib/libvtklz4-8.0.a /usr/local/lib/libvtkFiltersProgrammable-8.0.a /usr/local/lib/libvtkDICOMParser-8.0.a /usr/local/lib/libvtkRenderingOpenGL2-8.0.a /usr/local/lib/libvtkRenderingCore-8.0.a /usr/local/lib/libvtkCommonColor-8.0.a /usr/local/lib/libvtkglew-8.0.a /usr/local/lib/libvtkIOTecplotTable-8.0.a /usr/local/lib/libvtkFiltersSelection-8.0.a /usr/local/lib/libvtkRenderingImage-8.0.a /usr/local/lib/libvtkFiltersAMR-8.0.a /usr/local/lib/libvtkIOXML-8.0.a /usr/local/lib/libvtkIOXMLParser-8.0.a /usr/local/lib/libvtkexpat-8.0.a /usr/local/lib/libvtkParallelCore-8.0.a /usr/local/lib/libvtkIOLegacy-8.0.a /usr/local/lib/libvtkImagingStencil-8.0.a /usr/local/lib/libvtkhdf5_hl-8.0.a /usr/local/lib/libvtkhdf5-8.0.a /usr/local/lib/libvtkImagingMorphological-8.0.a /usr/local/lib/libvtklibharu-8.0.a /usr/local/lib/libvtkpng-8.0.a /usr/local/lib/libvtkIOAMR-8.0.a /usr/local/lib/libvtkFiltersTexture-8.0.a /usr/local/lib/libvtkproj4-8.0.a /usr/local/lib/libvtkViewsContext2D-8.0.a /usr/local/lib/libvtkRenderingContext2D-8.0.a /usr/local/lib/libvtkRenderingFreeType-8.0.a /usr/local/lib/libvtkfreetype-8.0.a /usr/local/lib/libvtkViewsCore-8.0.a /usr/local/lib/libvtkInteractionWidgets-8.0.a /usr/local/lib/libvtkFiltersHybrid-8.0.a /usr/local/lib/libvtkFiltersModeling-8.0.a /usr/local/lib/libvtkImagingColor-8.0.a /usr/local/lib/libvtkImagingHybrid-8.0.a /usr/local/lib/libvtkIOImage-8.0.a /usr/local/lib/libvtkmetaio-8.0.a /usr/local/lib/libvtkjpeg-8.0.a /usr/local/lib/libvtktiff-8.0.a /usr/local/lib/libvtkInteractionStyle-8.0.a /usr/local/lib/libvtkFiltersExtraction-8.0.a /usr/local/lib/libvtkRenderingAnnotation-8.0.a /usr/local/lib/libvtkRenderingVolume-8.0.a /usr/local/lib/libvtkRenderingGL2PSOpenGL2-8.0.a /usr/local/lib/libvtkgl2ps-8.0.a /usr/local/lib/libvtkTestingIOSQL-8.0.a /usr/local/lib/libvtkIOSQL-8.0.a /usr/local/lib/libvtksqlite-8.0.a /usr/local/lib/libvtkFiltersHyperTree-8.0.a /usr/local/lib/libvtkNetCDF-8.0.a /usr/local/lib/libvtkverdict-8.0.a /usr/local/lib/libvtkInfovisCore-8.0.a /usr/local/lib/libvtkRenderingLOD-8.0.a /usr/local/lib/libvtkRenderingContextOpenGL2-8.0.a /usr/local/lib/libvtkLocalExample-8.0.a /usr/local/lib/libvtkIOExportOpenGL2-8.0.a /usr/local/lib/libvtkIOExport-8.0.a /usr/local/lib/libvtkViewsInfovis-8.0.a /usr/local/lib/libvtkChartsCore-8.0.a /usr/local/lib/libvtkInfovisLayout-8.0.a /usr/local/lib/libvtkRenderingLabel-8.0.a /usr/local/lib/libvtkDomainsChemistry-8.0.a /usr/local/lib/libvtkexoIIc-8.0.a /usr/local/lib/libvtkFiltersSMP-8.0.a /usr/local/lib/libvtknetcdf_c++.a /usr/local/lib/libvtkFiltersParallelImaging-8.0.a /usr/local/lib/libvtkFiltersParallel-8.0.a /usr/local/lib/libvtkFiltersVerdict-8.0.a /usr/local/lib/libvtkInteractionImage-8.0.a /usr/local/lib/libvtkIOImport-8.0.a /usr/local/lib/libvtkTestingRendering-8.0.a /usr/local/lib/libvtklibxml2-8.0.a /usr/local/lib/libvtkIOParallel-8.0.a /usr/local/lib/libvtkIOGeometry-8.0.a /usr/local/lib/libvtkIONetCDF-8.0.a /usr/local/lib/libvtkjsoncpp-8.0.a /usr/local/lib/libvtkDomainsChemistryOpenGL2-8.0.a /usr/local/lib/libvtkFiltersPoints-8.0.a /usr/local/lib/libvtkoggtheora-8.0.a /usr/local/lib/libvtkTestingGenericBridge-8.0.a /usr/local/lib/libvtkIOMovie-8.0.a /usr/local/lib/libvtkImagingMath-8.0.a /usr/local/lib/libvtkIOVideo-8.0.a /usr/local/lib/libvtkGeovisCore-8.0.a /usr/local/lib/libvtkIOPLY-8.0.a /usr/local/lib/libvtkIOEnSight-8.0.a /usr/local/lib/libvtkIOInfovis-8.0.a /usr/local/lib/libvtkIOExodus-8.0.a /usr/local/lib/libvtkIOLSDyna-8.0.a /usr/local/lib/libvtkImagingStatistics-8.0.a /usr/local/lib/libvtkFiltersGeneric-8.0.a /usr/local/lib/libvtkFiltersTopology-8.0.a /usr/local/lib/libvtkIOMINC-8.0.a /usr/local/lib/libvtkRenderingVolumeOpenGL2-8.0.a /usr/local/lib/libvtkIOParallelXML-8.0.a -lgmp /usr/local/lib/libmpfr.so -lboost_log -lboost_log_setup -lboost_thread -lboost_date_time -lboost_filesystem -lboost_system -lboost_regex -lboost_chrono -lboost_atomic -lpthread /usr/local/lib/libitkgdcmMSFF-4.12.a /usr/local/lib/libitkgdcmDICT-4.12.a /usr/local/lib/libitkgdcmIOD-4.12.a /usr/local/lib/libitkgdcmDSED-4.12.a /usr/local/lib/libitkgdcmCommon-4.12.a /usr/local/lib/libitkgdcmjpeg8-4.12.a /usr/local/lib/libitkgdcmjpeg12-4.12.a /usr/local/lib/libitkgdcmjpeg16-4.12.a /usr/local/lib/libitkgdcmopenjpeg-4.12.a /usr/local/lib/libitkgdcmcharls-4.12.a /usr/local/lib/libitkgdmuuid-4.12.a /usr/local/lib/libITKNrrdIO-4.12.a /usr/local/lib/libitkpng-4.12.a /usr/local/lib/libITKIOXML-4.12.a /usr/local/lib/libITKMetaIO-4.12.a /usr/local/lib/libITKgiftiio-4.12.a /usr/local/lib/libITKEXPAT-4.12.a /usr/local/lib/libITKniftiio-4.12.a /usr/local/lib/libITKznz-4.12.a /usr/local/lib/libITKIOIPL-4.12.a /usr/local/lib/libITKIOTIFF-4.12.a /usr/local/lib/libitktiff-4.12.a /usr/local/lib/libitkjpeg-4.12.a /usr/local/lib/libitkhdf5_cpp.a /usr/local/lib/libitkhdf5.a /usr/local/lib/libitkzlib-4.12.a /usr/local/lib/libITKIOTransformBase-4.12.a /usr/local/lib/libITKTransformFactory-4.12.a /usr/local/lib/libITKSpatialObjects-4.12.a /usr/local/lib/libITKMesh-4.12.a /usr/local/lib/libITKTransform-4.12.a /usr/local/lib/libITKPath-4.12.a /usr/local/lib/libITKOptimizers-4.12.a /usr/local/lib/libITKStatistics-4.12.a /usr/local/lib/libitkNetlibSlatec-4.12.a /usr/local/lib/libITKIOImageBase-4.12.a /usr/local/lib/libITKVideoCore-4.12.a /usr/local/lib/libITKCommon-4.12.a /usr/local/lib/libitkdouble-conversion-4.12.a /usr/local/lib/libitksys-4.12.a /usr/local/lib/libITKVNLInstantiation-4.12.a /usr/local/lib/libitkvnl_algo-4.12.a /usr/local/lib/libitkvnl-4.12.a /usr/local/lib/libitkv3p_netlib-4.12.a /usr/local/lib/libitknetlib-4.12.a /usr/local/lib/libitkvcl-4.12.a /usr/local/lib/libvtkFiltersAMR-8.0.a /usr/local/lib/libvtklibharu-8.0.a /usr/local/lib/libvtkRenderingGL2PSOpenGL2-8.0.a /usr/local/lib/libvtkgl2ps-8.0.a /usr/local/lib/libvtkRenderingContext2D-8.0.a /usr/local/lib/libvtkFiltersImaging-8.0.a /usr/local/lib/libvtkverdict-8.0.a /usr/local/lib/libvtkFiltersParallel-8.0.a /usr/local/lib/libvtknetcdf_c++.a /usr/local/lib/libvtkDomainsChemistry-8.0.a /usr/local/lib/libvtkoggtheora-8.0.a /usr/local/lib/libvtkproj4-8.0.a /usr/local/lib/libvtkViewsCore-8.0.a /usr/local/lib/libvtkInteractionWidgets-8.0.a /usr/local/lib/libvtkImagingGeneral-8.0.a /usr/local/lib/libvtkRenderingAnnotation-8.0.a /usr/local/lib/libvtkRenderingFreeType-8.0.a /usr/local/lib/libvtkfreetype-8.0.a /usr/local/lib/libvtkImagingColor-8.0.a /usr/local/lib/libvtkInteractionStyle-8.0.a /usr/local/lib/libvtkInfovisLayout-8.0.a /usr/local/lib/libvtkFiltersModeling-8.0.a /usr/local/lib/libvtkImagingHybrid-8.0.a /usr/local/lib/libvtkInfovisCore-8.0.a /usr/local/lib/libvtkFiltersExtraction-8.0.a /usr/local/lib/libvtkFiltersStatistics-8.0.a /usr/local/lib/libvtkImagingFourier-8.0.a /usr/local/lib/libvtkalglib-8.0.a /usr/local/lib/libvtklibxml2-8.0.a /usr/local/lib/libvtkexoIIc-8.0.a /usr/local/lib/libvtkFiltersHybrid-8.0.a /usr/local/lib/libvtkImagingSources-8.0.a /usr/local/lib/libvtkIOImage-8.0.a /usr/local/lib/libvtkDICOMParser-8.0.a /usr/local/lib/libvtkpng-8.0.a -lm /usr/local/lib/libvtkmetaio-8.0.a /usr/local/lib/libvtktiff-8.0.a /usr/local/lib/libvtkjpeg-8.0.a -lm /usr/local/lib/libvtkNetCDF-8.0 。一种 /usr/local/lib/libvtkhdf5_hl-8.0.a /usr/local/lib/libvtkhdf5-8.0.a -lm /usr/local/lib/libvtkRenderingOpenGL2-8.0.a -lSM -lICE -lX11 -lXext -lXt /usr/local/lib/libvtkglew-8.0.a /usr/local/lib/libvtkRenderingVolume-8.0.a /usr/local/lib/libvtkImagingCore-8.0.a /usr/local/lib/libvtkRenderingCore-8.0.a /usr/local/lib/libvtkFiltersGeometry-8.0.a /usr/local/lib/libvtkFiltersSources-8.0.a /usr/local/lib/libvtkFiltersGeneral-8.0.a /usr/local/lib/libvtkFiltersCore-8.0.a /usr/local/lib/libvtkCommonComputationalGeometry-8.0.a /usr/local/lib/libvtkCommonColor-8.0.a /usr/local/lib/libvtkImagingMath-8.0.a -lGLU -lGL /usr/local/lib/libvtkIOXML-8.0.a /usr/local/lib/libvtkIOXMLParser-8.0.a /usr/local/lib/libvtkexpat-8.0.a /usr/local/lib/libvtkParallelCore-8.0.a /usr/local/lib/libvtkIOLegacy-8.0.a /usr/local/lib/libvtkIOCore-8.0.a /usr/local/lib/libvtkzlib-8.0.a /usr/local/lib/libvtkCommonExecutionModel-8.0.a /usr/local/lib/libvtkCommonDataModel-8.0.a /usr/local/lib/libvtkCommonTransforms-8.0.a /usr/local/lib/libvtkCommonMisc-8.0.a /usr/local/lib/libvtkCommonMath-8.0.a /usr/local/lib/libvtkCommonSystem-8.0.a /usr/local/lib/libvtkCommonCore-8.0.a /usr/local/lib/libvtksys-8.0.a -ldl -lpthread /usr/local/lib/libvtklz4-8.0.a -Wl,-rpath,/usr/local/lib ^[[A^[[A^[[A^[[A^[[Alibmeshlib.a (volumetric-image.cpp.o): 在函数中
VolumetricImage::ItkImageToCgalImage(itk::SmartPointer<itk::Image<char, 3u> >&, CGAL::Image_3&)': /home/n/Documents/b1/b1/src/volumetric-image.cpp:217: undefined reference to
_createImage(int,int,int,int,float,float,float, int, WORD_KIND, SIGN)' libmeshlib.a(volumetric-image.cpp.o): 在 函数CGAL::Image_3::Image_3(point_image*)': /usr/local/include/CGAL/Image_3.h:105: undefined reference to
CGAL::Image_3::private_read(point_image*)' collect2: error: ld 返回 1 退出状态 src/CMakeFiles/main.dir/build.make:419: recipe 对于目标 'src/main' 失败 make[2]: * [src/main] 错误 1 make[2]: 离开目录'/home/n/Documents/b1/b1/build' CMakeFiles/Makefile2:896:目标配方 'src/CMakeFiles/main.dir/all' 失败 make[1]: * [src/CMakeFiles/main.dir/all] 错误 2 make[1]: 离开目录 '/home/n/Documents/b1/b1/build' Makefile:83: 目标 'all' 的配方 制作失败:*** [all] 错误 2
【问题讨论】:
更新线程。 请运行make V=1
(或者可能是 VERBOSE=1)而不是 make
,然后发布失败的命令。 CXX_FLAGS 不是应该添加链接器标志的位置。
添加了更新,为什么不应该出于好奇将链接器标志添加到 CXX_FLAGS 中?
我的意思是打印在上面的一行,您应该在其中看到 g++、-lCGAL 等。我怀疑该行不正确(可能是错误的顺序,尤其是在 Ubuntu 上时)。
我更新了,如果我发布了你不需要的东西,请告诉我,抱歉,然后大声笑
【参考方案1】:
您似乎未能正确设置 CGAL 的链接。这个thread 应该会有所帮助。只需链接到 ITK 而不是 VTK。
【讨论】:
以上是关于CGAL:对 _createImage 的未定义引用的主要内容,如果未能解决你的问题,请参考以下文章
对`__glewCreateShader`的未定义引用[重复]
对“imp____glewEnableVertexAttribArray”的未定义引用
glfw + 代码块 + 对 `__gxx_personality_sj0' 的未定义引用