Programming/PCL

[PCL] LNK2019 ERROR

오뚜깅 2019. 4. 5. 13:52
반응형

Point Cloud Library를 사용하고 윈도우에서 처음 환경설정할 때는 어려움들이 많이 존재했다. 그 중에 겪었던 에러를 기록함으로서 나중에 필요할 때 다시 핸들링하려고 한다.

 

>"public: void __cdecl pcl::euclideanclusterextraction<struct pcl::pointnormal>::extract(class std::vector<struct pcl::pointindices,class std::allocator<struct pcl::pointindices> > &)" (?extract@?$euclideanclusterextraction@upointnormal@pcl@@@pcl@@qeaaxaeav?$vector@upointindices@pcl@@v?$allocator@upointindices@pcl@@@std@@@std@@@z) 외부 기호(참조 위치: main 함수)에서 확인하지 못했습니다.

 

PCL 튜토리얼을 잘 따라하다 보면 가끔씩 똑같은 코드를 카피엔 페이스트를 했는데도 불구하고 내 비주얼 스튜디오에서는 에러가 뜨는 경우가 있다.

 

위의 에러가 DoN, Difference of Normals Based Segmentation 튜토리얼을 시행하다가 생긴 에러다.

 

이 에러가 뜨면 무슨 이유인지 몰라서 다른 튜토리얼로 건너뛰곤 했다.

 

이 에러의 해결 방법은 매우 매우 간단하다.. 튜토리얼 예제 코드에서는 #include <pcl/segmentation/extract_clusters.h>만 추가해주고 있다.

근데 여기서 pcl/segmentation 경로에는 impl 이라는 폴더가 하나가 더 있고 그 폴더에 들어가보면, 헤더 파일과 동일한 명의 hpp파일이 또 존재한다.

해결은 여기서 끝이 난다. impl폴더에서 동일한 명의 hpp 파일을 #include 해주는 것이다. 그러면 모든 문제는 해결되고 컴파일이 성공적으로 돌아간다.. 크흡..

반응형