Error in PCL 1.7.1 source release (RE: Trying to compile PCL 1.7.1: Compiler complains of missing "at".)
Ok, I fixed this particular compilation problem. Once again (see my post yesterday regarding the 1.6 source distribution errors), there are apparent source code errors in the source distribution of this stable
release. This time, the errors that elicit this problem occur in two locations: “io/src/ply_io.cpp” and “io/include/pcl/io/ply/ply_parser.h”.
In ply_io.cpp, in a block of code circa line 696, there are a bunch of calls to a global (i.e. non-member) templated function “at” in the pcl.io.ply namespace. As it turns out, there is no such function. The
“at” function sought is the *member* function of ply_parser, which is declared in ply_parser.h. Fortunately, there’s an instance of ply_parser, which is also named ply_parser, upon which this function could be called. Replacing all occurrences of “pcl::io::ply::at”
with “ply_parser.at” eliminated the “’at’: identifier not found” errors.
Unfortunately, those errors were replaced with different errors: “'pcl::io::ply::ply_parser::at' : too many template arguments”. Looking back at the template definition in ply_parser.h, I noticed that the functions
are *defined* (not *declared*) with the “friend” keyword. This is, naturally, completely superfluous in this context, as the friend keyword grants access to *non*-member functions, and this is a member-function definition. Commenting out
the word “friend” in the four overloaded definitions removes all compilation errors in ply_io.cpp.
From:[hidden email] [mailto:[hidden email]]
On Behalf Of Chris Volpe ARA/SED Sent: Friday, August 01, 2014 4:10 PM To: pcl-users ([hidden email]) Subject: [PCL-users] Trying to compile PCL 1.7.1: Compiler complains of missing "at".
I am trying to compile PCL 1.7.1 with MSVS2013. I have either installed or built dependencies that at least CMake is happy with, including boost 1.55.0. I am encountering a very strange compiler (not linker) error; “strange” because it
does not appear to be the result of any interaction with a dependent library, but rather is entirely within the PCL source, which is supposedly a stable release.
One of the many occurrences of the error is as follows:
8>D:\Volpe\Software Downloads\PCL\pcl_1.7.1_src\pcl-pcl-1.7.1\pcl-pcl-1.7.1\io\src\ply_io.cpp(704): error C3861: 'at': identifier not found
It occurs a bunch of times in that file (ply_io.cpp), as well as a bunch of times in ply2ply.cpp and ply2raw.cpp.
As can be seen, “at” is a templated function nested three levels deep in namespaces. The cpp file #includes <pcl/io/ply_io.h>, which in turn #includes <pcl/io/ply/ply_parser.h>, which contains the definition:
The result of the function call is to yield a reference to a callback field within the argument structure, to which is then assigned the result of a boost::bind call. Everything looks fine and dandy, except that the definition of this “at”
function is not found. The header file ply_parser.h is definitely being processed up to that definition of “at”, as evidenced by an “#error” directive I temporarily placed just before it just to trace the header file compilation.
Re: Error in PCL 1.7.1 source release (RE: Trying to compile PCL 1.7.1: Compiler complains of missing "at".)
Thanks for the link to the pull request, Sergey. It's a bit ironic: I had chosen to work with an official release precisely so that I wouldn't be impeded by the kind of compilation-preventing bugs that one would find on the bleeding edge of the repository.
From: [hidden email] [mailto:[hidden email]] On Behalf Of Sergey
Sent: Monday, August 04, 2014 9:50 AM
To: [hidden email] Subject: Re: [PCL-users] Error in PCL 1.7.1 source release (RE: Trying to compile PCL 1.7.1: Compiler complains of missing "at".)
Indeed ironic! You avoided bleeding edge library version, but used bleeding edge compiler version :)
(Okay, MSVC13 is probably not really bleeding edge, but still newer than the compilers with which that
release was tested.)