PCL in Managed C++

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

PCL in Managed C++

FabiKirstein
Hello,

I'm including some PCL functionality into an extisting Visual Studio 2010 C++ project. This projects uses managed C++/CLI and the method where I have to include the PCL code is managed. This leads to some issues. It seems that the PCL uses some code which cannot be used in a managed function. I get then the error message: "this functon cannot be compiled as managed". I could resolve some of them with the macro EIGEN_DONT_ALIGN_STATICALLY. But know I'm using:

      pcl::NormalEstimation<PointType, NormalType> norm_est;

and this time the workaround is not working.
Is there any way to solve that issue? Or is it just not possible to use the entire PCL in managed C++?

Thanks a lot.
Reply | Threaded
Open this post in threaded view
|

Re: PCL in Managed C++

kwaegel
Administrator
FabiKirstein wrote
I'm including some PCL functionality into an extisting Visual Studio 2010 C++ project. This projects uses managed C++/CLI and the method where I have to include the PCL code is managed. This leads to some issues. It seems that the PCL uses some code which cannot be used in a managed function. I get then the error message: "this functon cannot be compiled as managed". I could resolve some of them with the macro EIGEN_DONT_ALIGN_STATICALLY. But know I'm using:

      pcl::NormalEstimation<PointType, NormalType> norm_est;

and this time the workaround is not working.
Is there any way to solve that issue? Or is it just not possible to use the entire PCL in managed C++?
Are you trying to compile PCL as a native C++/CLI library?

One alternative option would be to write a C++/CLI wrapper around the unmanaged PCL DLLs. I haven't done much of this myself, but there are plenty of resources online. I imagine this would be a bit of a pain, given all the data marshaling that would be required.
Reply | Threaded
Open this post in threaded view
|

Re: PCL in Managed C++

nenadpol
This post was updated on .
In reply to this post by FabiKirstein
Hi,
I have been using pcl in managed c++\cli. You have to make  C++/CLI wrapper and it will work fine.
Maybe this will help to start:
http://www.pcl-users.org/C-CLI-Wrapper-td4030941.html#a4030979

It is a little bit of work to write wrapper but on the other hand, advantage is that you can use this dll in any
.Net application.
I have only problems with pcl_visualization part.
When using pcl visualization .Net application crash on exit.

Thanks
Nenad
Reply | Threaded
Open this post in threaded view
|

Re: PCL in Managed C++

FabiKirstein
Thanks for the answers!
Just so that I get this straight: I would have to write for every class I want to use a wrapper class and compile them myself? This sounds like a lot of work!
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: PCL in Managed C++

kwaegel
Administrator
FabiKirstein wrote
Thanks for the answers!
Just so that I get this straight: I would have to write for every class I want to use a wrapper class and compile them myself? This sounds like a lot of work!
Thanks.
It is indeed a lot of work, but I just remembered a library called SWIG that aims to auto-generate the wrapper classes. I know people who have used it successfully, but I haven't tried it myself.
Reply | Threaded
Open this post in threaded view
|

Re: PCL in Managed C++

nenadpol
It is lot of work but it is best way of learning PCL

Cheers
Nenad
Reply | Threaded
Open this post in threaded view
|

Re: PCL in Managed C++

Mateusz
In reply to this post by FabiKirstein
FabiKirstein wrote
I'm including some PCL functionality into an extisting Visual Studio 2010 C++ project. This projects uses managed C++/CLI ...
If you wanna Native C++ you can create Win32 or eventually MFC project.