Reputation: 13
I'm trying to work with a 3rd party C++ source code (TORO framework for robotic SLAM, you may get it via svn with: svn co https://www.openslam.org/data/svn/toro), by trying to encapsulate it in a DLL to be used in my C# code later. However I get a variety of errors just by including the source files into my project. For example for the following code
void TreePoseGraph<Ops>::revertEdge(TreePoseGraph<Ops>::Edge * e){
revertEdgeInfo(e);
Vertex* ap=e->v2;
e->v2=e->v1;
e->v1=ap;
}
I get the following errors:
error C2182: 'revertEdge' : illegal use of type 'void'
error C2470: 'AISNavigation::TreePoseGraph::revertEdge' : looks like a function d definition, but there is no parameter list; skipping apparent body
error C2072: 'AISNavigation::TreePoseGraph::revertEdge' : initialization of a function
Of course the first thing I did was checking if it is included (revertEdge) in the right headers, and in the stdAfx.h and of course it was present everywhere. Moreover, IntelliSense recognizes everything, can point me to the source of everything, so it seems that nothing is missing from the project. Yet, I get a huge amount of errors of the similar kind.
I'm sure I'm doing something very wrong here right at the beginning, which causes all this dump of nonsense error messages (well there may be 1-2 reasonable, but the rest is just the result of the avalance). Could you give any suggestion what could result in getting such a huge set of error messages?
Upvotes: 1
Views: 370
Reputation: 6638
I think that this is how it should look:
template<class Ops> void TreePoseGraph<Ops>::revertEdge(TreePoseGraph<Ops>::Edge * e) {
// ...
}
Upvotes: 0
Reputation: 56863
Just a guess, but you might need a typename
before the TreePoseGraph<Ops>::Edge
in order to tell the compiler that Edge
is actually a type, i.e.,
void TreePoseGraph<Ops>::revertEdge(typename TreePoseGraph<Ops>::Edge * e)
{
// ...
}
Upvotes: 2