i'm trying to integrate the SymbolicC++ Library into an already existing solution. My specifications are as followed: Visual Studio 2010 RTM on a Windows 7 OS.
Now my problem:
I already have a solution where I want to integrate a function with symblic variables. There is another previously integrated library (The OMPL "Open Motion Planning Library). If i try to include the symbolicc++.h it fails to compile the solution by these errors:
Error 10 error C2825: '_Fty': must be a class or namespace when followed by '::' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28`
Error 11 error C2903: 'result' : symbol is neither a class template nor a function template c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error 12 error C2039: 'result' : is not a member of '`global namespace'' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error 13 error C2143: syntax error : missing ';' before '<' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error 14 error C2039: 'type' : is not a member of '`global namespace'' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error 15 error C2238: unexpected token(s) preceding ';' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 28
Error 16 error C2039: '_Type' : is not a member of 'std::tr1::_Result_type2<__formal,_Fty,_Arg0,_Arg1>' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error 17 error C2146: syntax error : missing ';' before identifier '_Type' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error 18 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error 19 error C2602: 'std::tr1::_Result_of2<_Fty,_Farg0,_Farg1>::_Type' is not a member of a base class of 'std::tr1::_Result_of2<_Fty,_Farg0,_Farg1>' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error 20 error C2868: 'std::tr1::_Result_of2<_Fty,_Farg0,_Farg1>::_Type' : illegal syntax for using-declaration; expected qualified-name c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxresult 40
Error 21 error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::tr1::_Bind_fty<_Fty,_Ret,_BindN>' (or there is no acceptable conversion) D:\Software\RobotKitV3.0\SensorPluginMotionPlanner\Zusatz\ompl_4_RK\RK_ServerSensor_ompl\RK_ServerSensor_ompl\ServerSensor_ompl.cpp 2587
I am quite sure there is some issue between the two libraries. But i'm not getting it to work properly.
There is one line (which is referred to the Error 21), when I change it from this:
if(bind(serverSocket, (sockaddr*) &addressServer, sizeof(addressServer)) == SOCKET_ERROR)
To this:
if(::bind(serverSocket, (sockaddr*) &addressServer, sizeof(addressServer)) == SOCKET_ERROR)
I don't have these errors anymore! But when i try to start the .exe it fails
with this error:
The application was unable to start correctly (0xc000007b). Click OK to close the application
unless i exclude the line:
#include <symbolicc++.h>
Has somebody an idea to get this work? It's so frustrating that i try to implement the symbolicc++.h since 5 days and can't execute my solution.
Edit:
So I made some progress. If I just comment out everything except this code below there is no error anymore.
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <winsock.h>
#include <fstream>
#include <iostream>
#include <string>
#include <WinBase.h>
#include "..\..\SymbolicC++\include\symbolicc++.h"
#include "ServerSensor_ompl.h"
#include <ompl/base/SpaceInformation.h>
#include <ompl/base/spaces/SE3StateSpace.h>
#include <ompl/base/spaces/SE2StateSpace.h>
#include <ompl/base/spaces/SO2StateSpace.h>
#include <ompl/geometric/planners/rrt/RRTConnect.h>
#include <ompl/geometric/SimpleSetup.h>
#include <ompl/config.h>
#include <ompl/geometric/planners/rrt/RRT.h>
#include <ompl/geometric/planners/rrt/RRTConnect.h>
#include <ompl/geometric/planners/rrt/RRTStar.h>
Symbolic Test("Test");
namespace ob = ompl::base;
namespace og = ompl::geometric;
namespace ob_Con_WP = ompl::base;
namespace og_Con_WP = ompl::geometric;
namespace ob_Con_RC = ompl::base; // Robot_Cell
namespace og_Con_RC = ompl::geometric; // Robot_Cell
WSADATA wsa;
struct sockaddr_in addressServer;
int commSocket, serverSocket;
bool RK_active = true;
int m_bufferLength = 0;
int m_bufferLength2 = 0;
const size_t BufferSize = 100000;
char m_buffer[BufferSize];
char m_buffer2[BufferSize];
int Trial_Cart = 0;
int Trial_Joint = 0;
int Trial_Constraint_WP = 0;
int Trial_Constraint_RC = 0;
int Trial_General = 0;
bool Have_Exact_Solution;
std::fstream f;
int countCalls = 0;
int countCallLimit = 1000;
double Constraint_Bounds[2][6];
ob::StateSpacePtr space_Joint(new ob::RealVectorStateSpace(6));
ob::StateSpacePtr space_Cart(new ob::SE3StateSpace);
ob_Con_WP::StateSpacePtr space_Constraint_WP(new ob_Con_WP::RealVectorStateSpace(6));
ob_Con_RC::StateSpacePtr space_Constraint_RC(new ob_Con_RC::RealVectorStateSpace(6));
ob_Con_RC::SpaceInformationPtr si(new ob_Con_RC::SpaceInformation(space_Constraint_RC));
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << "OMPL version: " << OMPL_VERSION << std::endl;
std::cout << std::endl << std::endl;
system("pause");
}
But for example if I try to put this line below into my code the same error (0xc000007B) occurs when I try to execute.
og::SimpleSetup ss_Cart(space_Cart);
Related
I am trying to use std::upper_bound with a vector defined by the Eigen libraries. I get some errors on visual studio 2017
#include <stdafx.h>
#include <stdio.h>
#include <Eigen/Dense>
#include <algorithm>
using namespace Eigen;
using namespace std;
int main(int argc, char* argv[])
{
VectorXd myVector= VectorXd::LinSpaced(20, -1.5, 6.4);
double trashold= strtod(argv[1], NULL);
double firstGreaterValue= std::upper_bound(myVector(0),
myVector(myVector.size()-1),trashold);
}
I expect the program to return the position of the first element that is greater than my input (that in this case is 1.1).
I get these errors on compiling
Severity Code Description Project File Line Suppression State
Error C2794 'difference_type': is not a member of any direct or indirect base class of 'std::iterator_traits<_FwdIt>' errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2347
Error C2938 '_Iter_diff_t<double>' : Failed to specialize alias template errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2347
Error C2672 'std::distance': no matching overloaded function found errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2347
Error C2893 Failed to specialize function template 'iterator_traits<_Iter>::difference_type std::distance(_InIt,_InIt)' errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2347
Error C2794 'difference_type': is not a member of any direct or indirect base class of 'std::iterator_traits<_FwdIt>' errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2351
Error C2938 '_Iter_diff_t<double>' : Failed to specialize alias template errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2351
Error C2672 'std::advance': no matching overloaded function found errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2353
Error C2893 Failed to specialize function template 'void std::advance(_InIt &,_Diff)' errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2353
Error C2100 illegal indirection errorExample C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\algorithm 2355
Until Version 3.4, Eigen::VectorXd is not compatible with STL algorithms since it does not provide iterators to access its elements.
Since Version 3.4, Eigen's dense matrices and arrays provide STL compatible iterators, then you can use begin()/end() method to get the iterator:
auto firstGreaterValueIter = std::upper_bound(myVector.begin(), myVector.end(), trashold);
Also don't forget std::upper_bound returns an iterator, so you must dereference to get the value:
if (firstGreaterValueIter != myVector.end()) {
double firstGreaterValue = *firstGreaterValueIter;
// ...
}
I'm having a weird error when trying to use 'QJsonObject::iterator' with MSVC2013.
I have the following example:
#include <QCoreApplication>
#include <QJsonObject>
#include <QDebug>
#include <algorithm>
void processValue(QJsonValue value) {
qDebug() << value.toString();
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QJsonObject jsonObject;
jsonObject.insert("a", "A");
jsonObject.insert("b", "B");
jsonObject.insert("c", "C");
jsonObject.insert("d", "D");
jsonObject.insert("e", "E");
std::for_each (jsonObject.begin(), jsonObject.end(), processValue);
return a.exec();
}
This code compiles and works as expected with MSVC2008 (cross-compiling to WinCE) and MinGW, but not with MSVC2013. In all cases, I'm using Qt 5.5.1.
The error message is:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(375) : error C2039: 'pointer' : is not a member of 'QJsonObject::iterator'
c:\qt\qt5.5.1msvc\5.5\msvc2013\include\qtcore\qjsonobject.h(96) : see declaration of 'QJsonObject::iterator'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(584) : see reference to class template instantiation 'std::iterator_traits<_InIt>' being compiled
with
[
_InIt=QJsonObject::iterator
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(31) : see reference to function template instantiation 'void std::_Debug_range<_InIt>(_InIt,_InIt,std::_Dbfile_t,std::_Dbline_t)' being compiled
with
[
_InIt=QJsonObject::iterator
]
..\QJsonObjectIteratorIssue\main.cpp(21) : see reference to function template instantiation '_Fn1 std::for_each<QJsonObject::iterator,void(__cdecl *)(QJsonValue)>(_InIt,_InIt,_Fn1)' being compiled
with
[
_Fn1=void (__cdecl *)(QJsonValue)
, _InIt=QJsonObject::iterator
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(375) : error C2146: syntax error : missing ';' before identifier 'pointer'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(375) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(375) : error C2602: 'std::iterator_traits<_InIt>::pointer' is not a member of a base class of 'std::iterator_traits<_InIt>'
with
[
_InIt=QJsonObject::iterator
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(375) : see declaration of 'std::iterator_traits<_InIt>::pointer'
with
[
_InIt=QJsonObject::iterator
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(375) : error C2868: 'std::iterator_traits<_InIt>::pointer' : illegal syntax for using-declaration; expected qualified-name
with
[
_InIt=QJsonObject::iterator
]
Am I doing anything wrong here, that just happen to work by chance on the 2 other compilers?
Use 5.6 or backport this: https://code.qt.io/cgit/qt/qtbase.git/commit/?id=4a318a61824216ac499ff8b0b0c55dea90501005
QJsonObject::(const_)iterator: add pointer typedef
Otherwise they're unusable with std::algorithms or anything else
that requires iterator_traits.
As stated in the subject i am in trouble getting a basic text processor to compile. The following code works in basic parts. That means. when find_text() and match() functions are excluded it gets a text file and reads it into a Document class and outputs it using print(). But when i include above mentioned functions and try to compile it gives large amount of error messages.
This code is from Stroustrup "Programming: practice and principles using c++" Chapter 20. In the exercises i should get sample code parts to run and continue writing a match() function. Can anyone point out the mistake in code? I am using Visual studio 2013 and a CTP November 2013 compiler.
#include <algorithm>
#include <string>
#include <vector>
#include <iostream>
#include<fstream>
#include<sstream>
#include <list>
using namespace std;
using Line = vector<char>; // a line is a vector of characters
//....................TEXT ITERATOR CLASS......................
class Text_iterator { // keep track of line and character position within a line
list<Line>::iterator ln;
Line::iterator pos;
public:
// start the iterator at line ll’s character position pp:
Text_iterator(list<Line>::iterator ll, Line::iterator pp)
:ln { ll }, pos { pp } { }
char& operator*() { return *pos; }
Text_iterator& operator++();
bool operator==(const Text_iterator& other) const {
return ln == other.ln && pos == other.pos;
}
bool operator!=(const Text_iterator& other) const {
return !(*this == other);
}
};
Text_iterator& Text_iterator::operator++() {
++pos; // proceed to next character
if (pos == (*ln).end()) {
++ln; // proceed to next line
pos = (*ln).begin(); // bad if ln==line.end(); so make sure it isn’t
}
return *this;
}
//....................DOCUMENT CLASS......................
struct Document {
list<Line> line; //doucument is a list of lines
Document() { line.push_back(Line { }); }
Text_iterator begin() // first character of first line
{
return Text_iterator(line.begin(), (*line.begin()).begin());
}
Text_iterator end() // one beyond the last character of the last line
{
auto last = line.end();
--last; // we know that the document is not empty
return Text_iterator(last, (*last).end());
}
};
istream& operator>>(istream& is, Document& d) {
for (char ch; is.get(ch);) {
d.line.back().push_back(ch); // add the character
if (ch == '\n')
d.line.push_back(Line { }); // add another line
}
if (d.line.back().size()) d.line.push_back(Line { }); // add final empty line
return is;
}
//....................HELPER FUNCTIONS......................
void erase_line(Document& d, int n) {
if (n < 0 || d.line.size() - 1 <= n) return;
auto p = d.line.begin();
advance(p, n);
d.line.erase(p);
}
void print(Document& d) {
for (auto p : d) cout << p;
// int the book sample code is different: "cout<<*p"` but the book code gives error of illegal transition. This would also need a comment
}
/*
bool match(Text_iterator first, Text_iterator last, const string& s) {
for (int i = 0; i < s.size(); ++i) {
if (*first == s[i]);
if (*first != s[i])return false;
}
return true;
}
Text_iterator find_txt(Text_iterator first, Text_iterator last, const string& s) {
if (s.size() == 0) return last; // can’t find an empty string
char first_char = s[0];
while (true) {
auto p = find(first, last, first_char);
if (p == last || match(p, last, s)) return p;
first = ++p; // look at the next character
}
}
*/
int main() {
string filename1 = "myDoc.txt";
ifstream stream { filename1 };
Document text1;
stream >> text1;
print(text1);
char ch; cin >> ch;
}
The errors I get are as follows:
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 371 1 text processing proov
Error 11 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 372 1 text processing proov
Error 16 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 373 1 text processing proov
Error 21 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 375 1 text processing proov
Error 26 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 376 1 text processing proov
Error 13 error C2868: 'std::iterator_traits<_InIt>::value_type' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 372 1 text processing proov
Error 28 error C2868: 'std::iterator_traits<_InIt>::reference' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 376 1 text processing proov
Error 23 error C2868: 'std::iterator_traits<_InIt>::pointer' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 375 1 text processing proov
Error 8 error C2868: 'std::iterator_traits<_InIt>::iterator_category' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 371 1 text processing proov
Error 18 error C2868: 'std::iterator_traits<_InIt>::difference_type' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 373 1 text processing proov
Error 29 error C2665: 'std::_Debug_range2' : none of the 2 overloads could convert all the argument types c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 584 1 text processing proov
Error 12 error C2602: 'std::iterator_traits<_InIt>::value_type' is not a member of a base class of 'std::iterator_traits<_InIt>' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 372 1 text processing proov
Error 27 error C2602: 'std::iterator_traits<_InIt>::reference' is not a member of a base class of 'std::iterator_traits<_InIt>' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 376 1 text processing proov
Error 22 error C2602: 'std::iterator_traits<_InIt>::pointer' is not a member of a base class of 'std::iterator_traits<_InIt>' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 375 1 text processing proov
Error 7 error C2602: 'std::iterator_traits<_InIt>::iterator_category' is not a member of a base class of 'std::iterator_traits<_InIt>' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 371 1 text processing proov
Error 17 error C2602: 'std::iterator_traits<_InIt>::difference_type' is not a member of a base class of 'std::iterator_traits<_InIt>' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 373 1 text processing proov
Error 10 error C2146: syntax error : missing ';' before identifier 'value_type' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 372 1 text processing proov
Error 25 error C2146: syntax error : missing ';' before identifier 'reference' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 376 1 text processing proov
Error 20 error C2146: syntax error : missing ';' before identifier 'pointer' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 375 1 text processing proov
Error 5 error C2146: syntax error : missing ';' before identifier 'iterator_category' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 371 1 text processing proov
Error 15 error C2146: syntax error : missing ';' before identifier 'difference_type' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 373 1 text processing proov
Error 9 error C2039: 'value_type' : is not a member of 'Text_iterator' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 372 1 text processing proov
Error 24 error C2039: 'reference' : is not a member of 'Text_iterator' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 376 1 text processing proov
Error 19 error C2039: 'pointer' : is not a member of 'Text_iterator' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 375 1 text processing proov
Error 4 error C2039: 'iterator_category' : is not a member of 'Text_iterator' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 371 1 text processing proov
Error 14 error C2039: 'difference_type' : is not a member of 'Text_iterator' c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 373 1 text processing proov
When you use a custom iterator when calling a function in the standard library, they have some expectations.
I am seeing errors:
'value_type' : is not a member of 'Text_iterator'
'reference' : is not a member of 'Text_iterator'
'pointer' : is not a member of 'Text_iterator'
'iterator_category' : is not a member of 'Text_iterator'
'difference_type' : is not a member of 'Text_iterator'
Take a look at the http://en.cppreference.com/w/cpp/iterator/iterator to understand what's expected of an iterator. You can fix your compiler problems by deriving Text_iterator from std::iterator.
class Text_iterator : public std::iterator<std::input_iterator_tag, char> {
...
};
I am a new user of C++ and point cloud library version 1.6. I would like to generate a graph based on point cloud data. My This is my cpp file:
#include <iostream>
#include <vector>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/common/io.h>
#include <boost/make_shared.hpp>
#include <boost/format.hpp>
#include <pcl/graph/point_cloud_graph.h>
int main (int argc, char** argv)
{
pcl::PointCloud <pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud <pcl::PointXYZ>);
if ( pcl::io::loadPCDFile <pcl::PointXYZ>("xyz_new.pcd", *cloud) == -1 )
{
std::cout << "Cloud reading failed." << std::endl;
return (-1);
}
//create a graph based on the cloud
pcl::graph::point_cloud_graph<pcl::PointXYZ> graph(cloud);
}
However, when I compile it has errors:
Error 1:
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2039: 'vertex_bundled' : is not a member of 'boost::vec_adj_list_impl<Graph,Config,Base>'
with
[
Graph=pcl::graph::point_cloud_graph<pcl::PointXYZ>,
Config=boost::detail::adj_list_gen<pcl::graph::point_cloud_graph<pcl::PointXYZ>,boost::vecS,boost::vecS,boost::undirectedS,boost::no_property,boost::no_property,boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ>>,boost::listS>::config,
Base=boost::undirected_graph_helper<boost::detail::adj_list_gen<pcl::graph::point_cloud_graph<pcl::PointXYZ>,boost::vecS,boost::vecS,boost::undirectedS,boost::no_property,boost::no_property,boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ>>,boost::listS>::config>
]
Error2:
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2146: syntax error : missing ',' before identifier 'vertex_bundled'
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2065: 'vertex_bundled' : undeclared identifier
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2955: 'boost::is_same' : use of class template requires template argument list
C:\Program Files (x86)\PCL 1.6.0\3rdParty\Boost\include\boost/type_traits/is_same.hpp(37) : see declaration of 'boost::is_same'
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2338: (boost::is_same<typename Base::vertex_bundled, boost::no_property>::value)
File point_cloud_graph.h is from the link: http://taketwo.github.io/tcs/point__cloud__graph_8h_source.html
I am getting errors like:
Error 24 error C2440: 'initializing' : cannot convert from 'std::_List_const_iterator<_Mylist>' to 'AttrValue' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory 208
Error 25 error C2100: illegal indirection c:\program files (x86)\microsoft visual studio 10.0\vc\include\xrefwrap 49
Error 26 error C2296: '.*' : illegal, left operand has type 'AttrValue' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xrefwrap 49
Error 37 error C2440: 'initializing' : cannot convert from 'std::_List_const_iterator<_Mylist>' to 'AttrValue' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory 208
Error 38 error C2100: illegal indirection c:\program files (x86)\microsoft visual studio 10.0\vc\include\xrefwrap 49
Error 39 error C2296: '.*' : illegal, left operand has type 'AttrValue' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xrefwrap 49
It doesn't point to my code so I dont exactly know whats wrong. But looking at MSDN docs, I was thinking the problems maybe caused by:
function<bool(AttrValue)> QueryEvaluatorPrivate::getClausePredicate(Relation clauseType, int preferedIndex) {
switch (clauseType) {
case UsesRelation:
if (preferedIndex == 0)
return &QueryEvaluatorPrivate::hasVarsUsed;
return &QueryEvaluatorPrivate::hasStmtsUsing;
case UsesPRelation:
if (preferedIndex == 0)
return &QueryEvaluatorPrivate::hasVarsUsedInProc;
return &QueryEvaluatorPrivate::hasProcsUsing;
}
}
hasVarsUsed and other has* functions are just functions that return a bool. Is there something wrong with this?
UPDATE
Following #Cameron's comment, in the output window is output. I think the offending line is output.insert(x) (last line):
...
function<bool(AttrValue)> clausePredicate = getClausePredicate(cl.type, prefered);
unordered_set<AttrValue> output;
if (prefered == pos) {
for (auto x = input.begin(); x != input.end(); ++x)
if (clausePredicate(*x))
output.insert(x);
...
But whats wrong with that? Maybe I am looking at the wrong place?
UPDATE 2
Fixed the 1st problem output.insert(x) should be output.insert(*x)... but I have
Error 6 error C2100: illegal indirection c:\program files (x86)\microsoft visual studio 10.0\vc\include\xrefwrap 49
I think the offending line is:
return &QueryEvaluatorPrivate::hasVarsUsed;
I am probably returning functions wrongly?
// function declaration
bool QueryEvaluatorPrivate::hasVarsUsed(StmtNum s)
It looks like you are trying to use a function with the wrong signature, maybe because StmtNum is a derived class of AttrValue? Here's an example to explain:
#include <functional>
struct A {};
struct B : A {};
void fa( A ) {}
void fb( B ) {}
int main()
{
std::function<void(A)> f1( &fa ); // OK
std::function<void(A)> f2( &fb ); // fails
}
In your code, I see function<bool(AttrValue)>, but the function is
bool QueryEvaluatorPrivate::hasVarsUsed(StmtNum s);
Also, this function has to be static as you can not simply mix free (or static) functions with member functions when passing around pointers to them.
x = input.begin() -> looks like x is some sort of iterator
Maybe you should do:
output.insert(*x)
instead of
output.insert(x)