-
Notifications
You must be signed in to change notification settings - Fork 71
Trouble compiling cpp to exe #14
Comments
Update: I have similar issues whenever I try to build anything from these folders. (openvr demo, synthetic hand tracker, etc) |
Errors like that certainly aren't obvious. One possibility... microsoft visual c++ (msvc) tends to be more forgiving about the ordering of overloaded template function. trying msvc with stricter conformance mode (/permissive- flag), attempts to compile generate similar error messages. To fix... Moving the serialization support for the linalg types (float3, int2, etc) to put them right inside of the json.h, to solved this problem. can you try grabbing the two json related header files in the attached zip and replacing the existing versions in the hand_tracking_samples/third_party/ subdirectory? |
Ah ! You're a complete lifesaver! C:\Users\O62220\AppData\Local\Temp\ccSc9f5t.o:realtime-hand-tracker.cpp:(.text+0xeb5): undefined reference to |
Wait sorry not run the .exe, these are the errors when trying to build the exe from the cpp |
These look like link-time errors, and seem to indicate it is not finding the opengl library. I'm not as familiar with g++. Perhaps you need to add -lGL on the command line so it will link with the opengl library. Start first with trying to compile and run the synthetic hand tracker demo program. other than opengl, it doesn't have additional dependencies. It doesn't need the realsense camera (and associated library) since it creates a fake depth map from rendering to the z-buffer, so For all the programs, in an effort to hopefully compile out of the box on PCs and maximize compatibility, the source code only uses opengl version 1.1 (opengl red book) function calls. Also, when compiling the source, you may want to add a flag to optimize the code, -O, so it isn't painfully slow. An alternative suggestion... From the filenames in the error message above, it looks like your on a PC Windows system. Have you tried just using visual studio (such as visual studio community 2019 free version), which uses the Microsoft visual c++ (MSVC) compiler? Is that an option? then the project files ( .sln and .vcxproj files) include any library dependencies. |
I am using visual code studio to try to run the real-time-hand-tracker.cpp
I have downloaded all of the folders from git and then I tried to build the .exe file with g++ compiler from mingw64. however this failed with a very very long list of errors and attempts to fix - after reading through the messages from the failed build, I think it is having trouble locating the right find_json() function frequently throughout the program.
I will paste the entire message below. Any help would be very much appreciated ! Thanks so much !
In file included from .\realtime-hand-tracker.cpp:26:
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<int, 2>; TS = {}]':
.../include/misc_image.h:57:60: required from 'void visit_fields(DCamera&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = DCamera; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../include/dcam.h:354:93: required from here
.../third_party/json.h:145:144: error: no matching function for call to 'from_json(linalg::vec<int, 2>&, const json::value&)'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
~~~~~~~~~^~~~~~~~~~~~~~~~
.../third_party/json.h:138:13: note: candidate: 'void from_json(bool&, const json::value&)'
inline void from_json(bool & b, const json::value & val) { b = val.is_true(); }
^~~~~~~~~
.../third_party/json.h:138:13: note: no known conversion for argument 1 from 'linalg::vec<int, 2>' to 'bool&'
.../third_party/json.h:139:13: note: candidate: 'void from_json(std::__cxx11::string&, const json::value&)'
inline void from_json(std::string & s, const json::value & val) { s = val.string(); }
^~~~~~~~~
.../third_party/json.h:139:13: note: no known conversion for argument 1 from 'linalg::vec<int, 2>' to 'std::__cxx11::string&' {aka 'std::__cxx11::basic_string&'}
.../third_party/json.h:140:79: note: candidate: 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&)'
template typename std::enable_if<std::is_arithmetic::value>::type from_json(T & n,
const json::value & val) { n = val.number(); }
^~~~~~~~~
.../third_party/json.h:140:79: note: template argument deduction/substitution failed:
.../third_party/json.h: In substitution of 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&) [with T = linalg::vec<int,
2>]':
.../third_party/json.h:145:144: required from 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<int, 2>; TS = {}]'
.../include/misc_image.h:57:60: required from 'void visit_fields(DCamera&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = DCamera; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../include/dcam.h:354:93: required from here
.../third_party/json.h:140:79: error: no type named 'type' in 'struct std::enable_if<false, void>'
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<int, 2>; TS = {}]':
.../include/misc_image.h:57:60: required from 'void visit_fields(DCamera&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = DCamera; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../include/dcam.h:354:93: required from here
.../third_party/json.h:141:31: note: candidate: 'template<class T, int N> void from_json(T (&)[N], const json::value&)'
template<class T, int N> void from_json(T (& a)[N], const json::value & val) { for(int i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:141:31: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: mismatched types 'T [N]' and 'linalg::vec<int, 2>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:142:34: note: candidate: 'template<class T, long long unsigned int N> void from_json(std::array<_Tp, _Nm>&, const json::value&)'
template<class T, size_t N> void from_json(std::array<T,N> & a, const json::value & val) { for(size_t i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:142:34: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<int, 2>' is not derived from 'std::array<_Tp, _Nm>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:143:24: note: candidate: 'template void from_json(std::vector&, const json::value&)'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:143:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<int, 2>' is not derived from 'std::vector'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:144:24: note: candidate: 'template void from_json(std::map<std::__cxx11::basic_string, T>&, const json::value&)'
template void from_json(std::map<std::string, T> & m, const json::value & val) { for (auto &e : val.get_object()) { from_json(m[e.first], e.second); } }
^~~~~~~~~
.../third_party/json.h:144:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<int, 2>' is not derived from 'std::map<std::__cxx11::basic_string, T>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 2>; TS = {}]':
.../include/misc_image.h:57:81: required from 'void visit_fields(DCamera&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = DCamera; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../include/dcam.h:354:93: required from here
.../third_party/json.h:145:144: error: no matching function for call to 'from_json(linalg::vec<float, 2>&, const json::value&)'
.../third_party/json.h:138:13: note: candidate: 'void from_json(bool&, const json::value&)'
inline void from_json(bool & b, const json::value & val) { b = val.is_true(); }
^~~~~~~~~
.../third_party/json.h:138:13: note: no known conversion for argument 1 from 'linalg::vec<float, 2>' to 'bool&'
.../third_party/json.h:139:13: note: candidate: 'void from_json(std::__cxx11::string&, const json::value&)'
inline void from_json(std::string & s, const json::value & val) { s = val.string(); }
^~~~~~~~~
.../third_party/json.h:139:13: note: no known conversion for argument 1 from 'linalg::vec<float, 2>' to 'std::__cxx11::string&' {aka 'std::__cxx11::basic_string&'}
.../third_party/json.h:140:79: note: candidate: 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&)'
template typename std::enable_if<std::is_arithmetic::value>::type from_json(T & n,
const json::value & val) { n = val.number(); }
^~~~~~~~~
.../third_party/json.h:140:79: note: template argument deduction/substitution failed:
.../third_party/json.h: In substitution of 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&) [with T = linalg::vec<float, 2>]':
.../third_party/json.h:145:144: required from 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 2>; TS = {}]'
.../include/misc_image.h:57:81: required from 'void visit_fields(DCamera&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = DCamera; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../include/dcam.h:354:93: required from here
.../third_party/json.h:140:79: error: no type named 'type' in 'struct std::enable_if<false, void>'
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 2>; TS = {}]':
.../include/misc_image.h:57:81: required from 'void visit_fields(DCamera&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = DCamera; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../include/dcam.h:354:93: required from here
.../third_party/json.h:141:31: note: candidate: 'template<class T, int N> void from_json(T (&)[N], const json::value&)'
template<class T, int N> void from_json(T (& a)[N], const json::value & val) { for(int i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:141:31: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: mismatched types 'T [N]' and 'linalg::vec<float, 2>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:142:34: note: candidate: 'template<class T, long long unsigned int N> void from_json(std::array<_Tp, _Nm>&, const json::value&)'
template<class T, size_t N> void from_json(std::array<T,N> & a, const json::value & val) { for(size_t i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:142:34: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 2>' is not derived from 'std::array<_Tp, _Nm>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:143:24: note: candidate: 'template void from_json(std::vector&, const json::value&)'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:143:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 2>' is not derived from 'std::vector'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:144:24: note: candidate: 'template void from_json(std::map<std::__cxx11::basic_string, T>&, const json::value&)'
template void from_json(std::map<std::string, T> & m, const json::value & val) { for (auto &e : val.get_object()) { from_json(m[e.first], e.second); } }
^~~~~~~~~
.../third_party/json.h:144:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 2>' is not derived from 'std::map<std::__cxx11::basic_string, T>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h: In instantiation of 'void from_json(std::vector&, const json::value&) [with T = linalg::vec<float, 3>]':
.../third_party/json.h:145:144: required from 'void field_decoder::operator()(const char*, T&, TS ...) [with T = std::vector<linalg::vec<float, 3> >; TS = {}]'
.../include/../third_party/wingmesh.h:975:3: required from 'void visit_fields(WingMesh&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = WingMesh; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = WingMesh]'
.../include/physmodel.h:447:48: required from here
.../third_party/json.h:143:157: error: no matching function for call to 'from_json(__gnu_cxx::__alloc_traits<std::allocator<linalg::vec<float, 3> >, linalg::vec<float, 3> >::value_type&, const json::value&)'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
.../third_party/json.h:138:13: note: candidate: 'void from_json(bool&, const json::value&)'
inline void from_json(bool & b, const json::value & val) { b = val.is_true(); }
^~~~~~~~~
.../third_party/json.h:138:13: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<linalg::vec<float, 3> >, linalg::vec<float, 3> >::value_type' {aka 'linalg::vec<float, 3>'} to 'bool&'
.../third_party/json.h:139:13: note: candidate: 'void from_json(std::__cxx11::string&, const json::value&)'
inline void from_json(std::string & s, const json::value & val) { s = val.string(); }
^~~~~~~~~
.../third_party/json.h:139:13: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<linalg::vec<float, 3> >, linalg::vec<float, 3> >::value_type' {aka 'linalg::vec<float, 3>'} to 'std::__cxx11::string&' {aka 'std::__cxx11::basic_string&'}
.../third_party/json.h:140:79: note: candidate: 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&)'
template typename std::enable_if<std::is_arithmetic::value>::type from_json(T & n,
const json::value & val) { n = val.number(); }
^~~~~~~~~
.../third_party/json.h:140:79: note: template argument deduction/substitution failed:
.../third_party/json.h: In substitution of 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&) [with T = linalg::vec<float, 3>]':
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = linalg::vec<float, 3>]'
.../third_party/json.h:145:144: required from 'void field_decoder::operator()(const char*, T&, TS ...) [with T = std::vector<linalg::vec<float, 3> >; TS = {}]'
.../include/../third_party/wingmesh.h:975:3: required from 'void visit_fields(WingMesh&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = WingMesh; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = WingMesh]'
.../include/physmodel.h:447:48: required from here
.../third_party/json.h:140:79: error: no type named 'type' in 'struct std::enable_if<false, void>'
.../third_party/json.h: In instantiation of 'void from_json(std::vector&, const json::value&) [with T = linalg::vec<float, 3>]':
.../third_party/json.h:145:144: required from 'void field_decoder::operator()(const char*, T&, TS ...) [with T = std::vector<linalg::vec<float, 3> >; TS = {}]'
.../include/../third_party/wingmesh.h:975:3: required from 'void visit_fields(WingMesh&, F) [with F = field_decoder]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = WingMesh; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = WingMesh]'
.../include/physmodel.h:447:48: required from here
.../third_party/json.h:141:31: note: candidate: 'template<class T, int N> void from_json(T (&)[N], const json::value&)'
template<class T, int N> void from_json(T (& a)[N], const json::value & val) { for(int i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:141:31: note: template argument deduction/substitution failed:
.../third_party/json.h:143:157: note: mismatched types 'T [N]' and '__gnu_cxx::__alloc_traits<std::allocator<linalg::vec<float, 3> >, linalg::vec<float, 3> >::value_type' {aka 'linalg::vec<float, 3>'}
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
.../third_party/json.h:142:34: note: candidate: 'template<class T, long long unsigned int N> void from_json(std::array<_Tp, _Nm>&, const json::value&)'
template<class T, size_t N> void from_json(std::array<T,N> & a, const json::value & val) { for(size_t i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:142:34: note: template argument deduction/substitution failed:
.../third_party/json.h:143:157: note: '__gnu_cxx::__alloc_traits<std::allocator<linalg::vec<float, 3> >, linalg::vec<float, 3> >::value_type' {aka 'linalg::vec<float, 3>'} is not derived from 'std::array<_Tp, _Nm>'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
.../third_party/json.h:143:24: note: candidate: 'template void from_json(std::vector&, const json::value&)'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:143:24: note: template argument deduction/substitution failed:
.../third_party/json.h:143:157: note: '__gnu_cxx::__alloc_traits<std::allocator<linalg::vec<float, 3> >, linalg::vec<float, 3> >::value_type' {aka 'linalg::vec<float, 3>'} is not derived from 'std::vector'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 3>; TS = {}]':
.../include/physmodel.h:244:76: required from 'void PhysModel::Joint::visit_fields(F) [with F = field_decoder]'
.../third_party/misc.h:110:58: required from 'void visit_fields(T&, F) [with F = field_decoder; T = PhysModel::Joint]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = PhysModel::Joint; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = PhysModel::Joint]'
.../include/physmodel.h:449:36: required from here
.../third_party/json.h:145:144: error: no matching function for call to 'from_json(linalg::vec<float, 3>&, const json::value&)'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:138:13: note: candidate: 'void from_json(bool&, const json::value&)'
inline void from_json(bool & b, const json::value & val) { b = val.is_true(); }
^~~~~~~~~
.../third_party/json.h:138:13: note: no known conversion for argument 1 from 'linalg::vec<float, 3>' to 'bool&'
.../third_party/json.h:139:13: note: candidate: 'void from_json(std::__cxx11::string&, const json::value&)'
inline void from_json(std::string & s, const json::value & val) { s = val.string(); }
^~~~~~~~~
.../third_party/json.h:139:13: note: no known conversion for argument 1 from 'linalg::vec<float, 3>' to 'std::__cxx11::string&' {aka 'std::__cxx11::basic_string&'}
.../third_party/json.h:140:79: note: candidate: 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&)'
template typename std::enable_if<std::is_arithmetic::value>::type from_json(T & n,
const json::value & val) { n = val.number(); }
^~~~~~~~~
.../third_party/json.h:140:79: note: template argument deduction/substitution failed:
.../third_party/json.h: In substitution of 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&) [with T = linalg::vec<float, 3>]':
.../third_party/json.h:145:144: required from 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 3>; TS = {}]'
.../include/physmodel.h:244:76: required from 'void PhysModel::Joint::visit_fields(F) [with F = field_decoder]'
.../third_party/misc.h:110:58: required from 'void visit_fields(T&, F) [with F = field_decoder; T = PhysModel::Joint]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = PhysModel::Joint; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = PhysModel::Joint]'
.../include/physmodel.h:449:36: required from here
.../third_party/json.h:140:79: error: no type named 'type' in 'struct std::enable_if<false, void>'
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 3>; TS = {}]':
.../include/physmodel.h:244:76: required from 'void PhysModel::Joint::visit_fields(F) [with F = field_decoder]'
.../third_party/misc.h:110:58: required from 'void visit_fields(T&, F) [with F = field_decoder; T = PhysModel::Joint]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = PhysModel::Joint; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = PhysModel::Joint]'
.../include/physmodel.h:449:36: required from here
.../third_party/json.h:141:31: note: candidate: 'template<class T, int N> void from_json(T (&)[N], const json::value&)'
template<class T, int N> void from_json(T (& a)[N], const json::value & val) { for(int i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:141:31: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: mismatched types 'T [N]' and 'linalg::vec<float, 3>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:142:34: note: candidate: 'template<class T, long long unsigned int N> void from_json(std::array<_Tp, _Nm>&, const json::value&)'
template<class T, size_t N> void from_json(std::array<T,N> & a, const json::value & val) { for(size_t i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:142:34: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 3>' is not derived from 'std::array<_Tp, _Nm>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:143:24: note: candidate: 'template void from_json(std::vector&, const json::value&)'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:143:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 3>' is not derived from 'std::vector'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:144:24: note: candidate: 'template void from_json(std::map<std::__cxx11::basic_string, T>&, const json::value&)'
template void from_json(std::map<std::string, T> & m, const json::value & val) { for (auto &e : val.get_object()) { from_json(m[e.first], e.second); } }
^~~~~~~~~
.../third_party/json.h:144:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 3>' is not derived from 'std::map<std::__cxx11::basic_string, T>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 4>; TS = {}]':
.../include/physmodel.h:244:140: required from 'void PhysModel::Joint::visit_fields(F) [with
F = field_decoder]'
.../third_party/misc.h:110:58: required from 'void visit_fields(T&, F) [with F = field_decoder; T = PhysModel::Joint]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = PhysModel::Joint; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = PhysModel::Joint]'
.../include/physmodel.h:449:36: required from here
.../third_party/json.h:145:144: error: no matching function for call to 'from_json(linalg::vec<float, 4>&, const json::value&)'
.../third_party/json.h:138:13: note: candidate: 'void from_json(bool&, const json::value&)'
inline void from_json(bool & b, const json::value & val) { b = val.is_true(); }
^~~~~~~~~
.../third_party/json.h:138:13: note: no known conversion for argument 1 from 'linalg::vec<float, 4>' to 'bool&'
.../third_party/json.h:139:13: note: candidate: 'void from_json(std::__cxx11::string&, const json::value&)'
inline void from_json(std::string & s, const json::value & val) { s = val.string(); }
^~~~~~~~~
.../third_party/json.h:139:13: note: no known conversion for argument 1 from 'linalg::vec<float, 4>' to 'std::__cxx11::string&' {aka 'std::__cxx11::basic_string&'}
.../third_party/json.h:140:79: note: candidate: 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&)'
template typename std::enable_if<std::is_arithmetic::value>::type from_json(T & n,
const json::value & val) { n = val.number(); }
^~~~~~~~~
.../third_party/json.h:140:79: note: template argument deduction/substitution failed:
.../third_party/json.h: In substitution of 'template typename std::enable_if<std::is_arithmetic<_Tp>::value, void>::type from_json(T&, const json::value&) [with T = linalg::vec<float, 4>]':
.../third_party/json.h:145:144: required from 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 4>; TS = {}]'
.../include/physmodel.h:244:140: required from 'void PhysModel::Joint::visit_fields(F) [with
F = field_decoder]'
.../third_party/misc.h:110:58: required from 'void visit_fields(T&, F) [with F = field_decoder; T = PhysModel::Joint]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = PhysModel::Joint; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = PhysModel::Joint]'
.../include/physmodel.h:449:36: required from here
.../third_party/json.h:140:79: error: no type named 'type' in 'struct std::enable_if<false, void>'
.../third_party/json.h: In instantiation of 'void field_decoder::operator()(const char*, T&, TS ...) [with T = linalg::vec<float, 4>; TS = {}]':
.../include/physmodel.h:244:140: required from 'void PhysModel::Joint::visit_fields(F) [with
F = field_decoder]'
.../third_party/misc.h:110:58: required from 'void visit_fields(T&, F) [with F = field_decoder; T = PhysModel::Joint]'
.../third_party/json.h:146:130: required from 'typename std::enable_if<std::is_class<_Tp>::value>::type from_json(T&, const json::value&) [with T = PhysModel::Joint; typename std::enable_if<std::is_class<_Tp>::value>::type = void]'
.../third_party/json.h:143:157: required from 'void from_json(std::vector&, const json::value&) [with T = PhysModel::Joint]'
.../include/physmodel.h:449:36: required from here
.../third_party/json.h:141:31: note: candidate: 'template<class T, int N> void from_json(T (&)[N], const json::value&)'
template<class T, int N> void from_json(T (& a)[N], const json::value & val) { for(int i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:141:31: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: mismatched types 'T [N]' and 'linalg::vec<float, 4>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:142:34: note: candidate: 'template<class T, long long unsigned int N> void from_json(std::array<_Tp, _Nm>&, const json::value&)'
template<class T, size_t N> void from_json(std::array<T,N> & a, const json::value & val) { for(size_t i=0; i<N; ++i) from_json(a[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:142:34: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 4>' is not derived from 'std::array<_Tp, _Nm>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:143:24: note: candidate: 'template void from_json(std::vector&, const json::value&)'
template void from_json(std::vector & v, const json::value & val) { v.resize(val.get_array().size()); for(size_t i=0; i<v.size(); ++i) from_json(v[i], val[i]); }
^~~~~~~~~
.../third_party/json.h:143:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 4>' is not derived from 'std::vector'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field, TS...) { from_json(field, v[name]); } };
.../third_party/json.h:144:24: note: candidate: 'template void from_json(std::map<std::__cxx11::basic_string, T>&, const json::value&)'
template void from_json(std::map<std::string, T> & m, const json::value & val) { for (auto &e : val.get_object()) {
from_json(m[e.first], e.second); } }
^~~~~~~~~
.../third_party/json.h:144:24: note: template argument deduction/substitution failed:
.../third_party/json.h:145:144: note: 'linalg::vec<float, 4>' is not derived from 'std::map<std::__cxx11::basic_string, T>'
struct field_decoder { const json::value & v; template<class T, class... TS> void operator () (const char * name, T & field,
TS...) { from_json(field, v[name]); } };
The text was updated successfully, but these errors were encountered: