好多天没写了,来水一章。

前段时间有用pcl库,我是在windows 10,用visual studio和cmake搭建的环境,下载pcl all in one 然后配置下路径就可以了。

在跟着官方教程走的时候,发现有个链接错误。我是完全按照教程复制的代码。后来发现是缺了一个头文件。参考的是csdn的这篇文章https://blog.csdn.net/sinat_24206709/article/details/77861897

我仔细看了看,为什么少了一个头文件会引起连接错误呢?一般来说,少了头文件,就少了函数或者变量声明,会引起的是编译器未定义的错误。这里引起连接错误,是因为模板的原因。由于使用了模板,代码的实现就要在头文件中。pcl把这部分实现放在了一个单独的头文件中。即

pcl::segmentation/extract_clusters.h 中包含了模板函数定义
pcl/segmentation/impl/extract_clusters.hpp 中包含了模板函数实现

官网教程的代码只引用了第一个头文件,所以有定义,因此没有报编译错误。但是在链接阶段就会发现符号未定义(因为没有按照模板参数生成对应的代码),所以会报连接错误。

从这里可以看出c++的泛型更像是一个代码生成机制,和java或者c#中不大一样。模板的具体实现无法放到库里,必须参与编译也限制了源代码的管理

2 对 “使用PCL时遇到链接错误 error Link 2019”的想法;

  1. Hi! Someonne in my Myspace grolup sshared his site with us so I
    cane to give it a look. I’m definitely loving tthe information. I’m bookmarking and wwill be tweeting ths to
    my followers! Wonderful blog and fantastic design. auroravpn

  2. Increase sperm count otcWife fucked and drinks stockingsCarrie prejean nude
    phototsWoman in bikini and constrictorFit mature and shavedClassic clip free jeremy porn ronEasy halloween crafts for adultsPenis enlargement exercises pictures
    xnxx Differant ways to have sexNaked women 50 60 70 years oldPrints gay men artRent slutMotorcycle slutFree yiff hentaiEffects interracial marriageHow do you
    straighten your penisWomen 45 plus nude https://new.xnxxtubexxx.cc/ Bollywood actresses fake sex videosUncercumsized penisesSecrets of the sex surrogateNude facebook
    searchProlapsed rectum sexJunior high shemalesChange sex transsexual transsexual transsexualism transsexualitySleeping sex toys
    girls xnxx Xxx free no credit card neededFree xxx henti
    videos2006 avn best anal scene2005 national npc teenWas britney seen nakedThe nude of
    female photographYunho thrust cockEating pussy and photo

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注