grsd.hpp causes building errors? Windows 7 x64 msvc2010

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

grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
Hi all,

I'm trying to build the new PCL trunk (downloaded from github today). However, I get a lot of errors from libraries that have not been build during all_build. When I try to build just the pcl_features_lib, the following error occurs:
error C2668: 'sqrt': ambiguous call to overloaded function                                                          
error C2780: 'const_Ty &std::max(const_Ty &,const_Ty &,_Pr)' expects 3 arguments - 2 provided    
both on line 90 inside grsd.hpp, which reads:
rsd.setRadiusSearch (std::max (search_radius_, sqrt (3) * width_ / 2));
std::max seems to be defined in xutility (twice, on line 2078 and 2086)
                // TEMPLATE FUNCTION max
template<class _Ty> inline
        const _Ty& (max)(const _Ty& _Left, const _Ty& _Right)
        { // return larger of _Left and _Right
        return (_DEBUG_LT(_Left, _Right) ? _Right : _Left);
        }

                // TEMPLATE FUNCTION max WITH PRED
template<class _Ty,
        class _Pr> inline
        const _Ty& (max)(const _Ty& _Left, const _Ty& _Right, _Pr _Pred)
        { // return larger of _Left and _Right using _Pred
        return (_DEBUG_LT_PRED(_Pred, _Left, _Right) ? _Right : _Left);
        }
As the pcl_features_lib fails to build, so do all libraries that have this lib as dependency. Maybe I just F*d up, but does anyone have an idea how to resolve this problem?
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
after changing line 90 in grsd.hpp
// rsd.setRadiusSearch (std::max (search_radius_, sqrt (3) * width_ / 2));
// changed to
rsd.setRadiusSearch (std::max (search_radius_, sqrtf (3) * width_ / 2));
I got a different error about "library limit of 65535 objects exceeded", similar to:
http://www.pcl-users.org/PCL-Features-Library-Limit-Exceeded-td4026817.html#a4035093

When I changed the cmake cache to building static libs instead of shared pcl_features_lib builded without problems. Now building ALL_BUILD with static libs...
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
1 building error
harris_2d.hpp line 340, 376 and 412: unsigned integral type size_t used in a for loop
changed to size_t to int and problem was resolved
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

Sergey
Administrator
Hi Ruben,

Could you please check if changing

    sqrt (3)

into

    std::sqrt (3)

solves the first issue on MSVC?

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
Hi Sergey,

today I won't have time, but tomorrow I'll try! Probably build with shared libs option enabled as well.

BR,
Ruben
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
In reply to this post by Sergey
Hi Sergey,

std::sqrt(3) creates the exact same error.
error C2668: 'std::sqrt': ambiguous call to overloaded function                                                          
error C2780: 'const_Ty &std::max(const_Ty &,const_Ty &,_Pr)' expects 3 arguments - 2 provided
BR,
Ruben
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

Sergey
Administrator
Ruben,

Could you also try

    std::sqrt(3.0)

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
Sure,
rsd.setRadiusSearch (std::max (search_radius_, std::sqrt(3.0) * width_ / 2));
gives a link library limit "library limit of 65535 objects exceeded"
(shared libs turned on!) so will probably work with static libs. I'll try that now.

BR,
Ruben
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
Yeah, works!
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

Sergey
Administrator
Ruben,

Thanks for checking. I prefer using `std::sqrt` over `sqrtf` because the former is a C++ function,
whereas the latter comes from old C standard library. Could you please submit pull requests for
this and for the other fix you mentioned?

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: grsd.hpp causes building errors? Windows 7 x64 msvc2010

ruben
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Sergey,

I made 1 pull request out of it. However, LF's might have been changed to CRLF...

BR,
Ruben