PointCloudLibrary / PointCloudLibrary/pcl
[windows] error linking pcl rangeimage LNK2020 LNK2001 LNK1120
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
I have a visual C++ project of Dynamic
Library (.dll) type. This is beacuse I want to use that C++ dll that I
build from a C# project. I use your PCL library 1.6 and it works well.
The problem appears when I include the range_image.h . The problem is that
the RangeImage class have
static const int lookup_table_size;
static std::vector asin_lookup_table;
static std::vector atan_lookup_table;
static std::vector cos_lookup_table;
and they are referenced by static inline method, an when you compile
it like a .dll using the Common Language Runtime Support (/clr) it
gives these errors
Error 80 error LNK2020: unresolved token (0A003A6D) "protected: static
class std::vector<float,class std::allocator<float> >
pcl::RangeImage::asin_lookup_table"
(?asin_lookup_table@RangeImage@pcl@@1V?$vector@MV?$allocator@M@std@@@std@@A)
Error 79 error LNK2020: unresolved token (0A003A6C) "protected: static
int const pcl::RangeImage::lookup_table_size"
(?lookup_table_size@RangeImage@pcl@@1HB)
Error 78 error LNK2020: unresolved token (0A003A6B) "protected: static
class std::vector<float,class std::allocator<float> >
pcl::RangeImage::atan_lookup_table"
(?atan_lookup_table@RangeImage@pcl@@1V?$vector@MV?$allocator@M@std@@@std@@A)
Error 77 error LNK2020: unresolved token (0A003A6A) "protected: static
class std::vector<float,class std::allocator<float> >
pcl::RangeImage::cos_lookup_table"
(?cos_lookup_table@RangeImage@pcl@@1V?$vector@MV?$allocator@M@std@@@std@@A)
Error 81 error LNK2001: unresolved external symbol "public: virtual
void __cdecl pcl::RangeImage::getSubImage(int,int,int,int,int,class
pcl::RangeImage &)const "
(?getSubImage@RangeImage@pcl@@UEBAXHHHHHAEAV12@@Z)
Error 82 error LNK2001: unresolved external symbol "public: virtual
void __cdecl pcl::RangeImage::getHalfImage(class pcl::RangeImage
&)const " (?getHalfImage@RangeImage@pcl@@UEBAXAEAV12@@Z)
Error 83 error LNK2001: unresolved external symbol "protected: static
int const pcl::RangeImage::lookup_table_size"
(?lookup_table_size@RangeImage@pcl@@1HB)
Error 86 error LNK2001: unresolved external symbol "protected: static
class std::vector<float,class std::allocator<float> >
pcl::RangeImage::cos_lookup_table"
(?cos_lookup_table@RangeImage@pcl@@1V?$vector@MV?$allocator@M@std@@@std@@A)
Error 87 error LNK1120: 10 unresolved externals
I found a similar problem reported at this post
http://www.pcl-users.org/FW-Link-time-errors-in-RangeImage-with-clr-td3581422.html
but that post is from 2011 and pcl version 1.3.0. Apparently it was solve in version 1.4.0 but I have a similar problem now with pcl version 1.6.0.
Is there a way to fix this? I'm I doing something wrong? Please, help me.
thank you for take a time to read mi question.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with range_image.h and the PCL 1.6 Windows build configuration used with Visual C++ and /clr. Reproduce the linker output, then trace the unresolved RangeImage symbols and compare the setup with the referenced PCL 1.3.0 report. Done means the same DLL project links without the listed unresolved externals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100