chili-epfl / chilitags

Robust Fiducial Markers for Augmented Reality And Robotics
http://chili.epfl.ch/software
123 stars 57 forks source link

Compilation fails on Visual Studio 2012 #16

Closed kshitijkshitij closed 9 years ago

kshitijkshitij commented 10 years ago

Here I post the errors for each file;

FindQuadsWithLSD.cpp
1>findquadswithlsd.cpp(58): error C2552: 'seg00' : non-aggregates cannot be initialized with initializer list
1>          'cv::Point_<_Tp>' : Types with user defined constructors are not aggregate
1>          with
1>          [
1>              _Tp=float
1>          ]
1>findquadswithlsd.cpp(59): error C2552: 'seg01' : non-aggregates cannot be initialized with initializer list
1>          'cv::Point_<_Tp>' : Types with user defined constructors are not aggregate
1>          with
1>          [
1>              _Tp=float
1>          ]
1>findquadswithlsd.cpp(68): error C2552: 'seg10' : non-aggregates cannot be initialized with initializer list
1>          'cv::Point_<_Tp>' : Types with user defined constructors are not aggregate
1>          with
1>          [
1>              _Tp=float
1>          ]
1>findquadswithlsd.cpp(69): error C2552: 'seg11' : non-aggregates cannot be initialized with initializer list
1>          'cv::Point_<_Tp>' : Types with user defined constructors are not aggregate
1>          with
1>          [
1>              _Tp=float
1>          ]
1>findquadswithlsd.cpp(118): error C2552: 'p0' : non-aggregates cannot be initialized with initializer list
1>          'cv::Vec<_Tp,cn>' : Types with a base are not aggregate
1>          with
1>          [
1>              _Tp=float,
1>              cn=2
1>          ]
1>findquadswithlsd.cpp(119): error C2552: 'p1' : non-aggregates cannot be initialized with initializer list
1>          'cv::Vec<_Tp,cn>' : Types with a base are not aggregate
1>          with
1>          [
1>              _Tp=float,
1>              cn=2
1>          ]
1>findquadswithlsd.cpp(138): error C2143: syntax error : missing ')' before '{'
1>findquadswithlsd.cpp(138): error C2661: 'std::vector<_Ty>::push_back' : no overloaded function takes 0 arguments
1>          with
1>          [
1>              _Ty=cv::Vec2i
1>          ]
1>findquadswithlsd.cpp(138): error C2143: syntax error : missing ';' before '{'
1>findquadswithlsd.cpp(138): error C2143: syntax error : missing ';' before '}'
1>findquadswithlsd.cpp(138): error C2059: syntax error : ')'
1>findquadswithlsd.cpp(147): error C2065: 'LSD_REFINE_NONE' : undeclared identifier
1>findquadswithlsd.cpp(147): error C3861: 'createLineSegmentDetector': identifier not found
1>findquadswithlsd.cpp(149): error C2614: 'chilitags::FindQuads' : illegal member initialization: 'lsd' is not a base or member
1>findquadswithlsd.cpp(167): error C2065: 'lsd' : undeclared identifier
1>findquadswithlsd.cpp(167): error C2227: left of '->detect' must point to class/struct/union/generic type
1>          type is ''unknown-type''
1>findquadswithlsd.cpp(238): error C2552: 'rawquad' : non-aggregates cannot be initialized with initializer list
1>          'std::vector<_Ty>' : Types with a base are not aggregate
1>          with
1>          [
1>              _Ty=cv::Point2f
1>          ]
1>findquadswithlsd.cpp(242): error C3861: 'convexHull': identifier not found
--------------------------------------------------------------------------------------------------------------------------------
ReadBits.cpp
1>readbits.cpp(43): error C2059: syntax error : '{'
1>readbits.cpp(43): error C2143: syntax error : missing ';' before '{'
1>readbits.cpp(43): error C2143: syntax error : missing ';' before '}'
1>readbits.cpp(43): error C2143: syntax error : missing ';' before ','
1>readbits.cpp(44): error C2143: syntax error : missing ';' before '{'
1>readbits.cpp(44): error C2143: syntax error : missing ';' before '}'
1>readbits.cpp(44): error C2143: syntax error : missing ';' before ','
1>readbits.cpp(45): error C2143: syntax error : missing ';' before '{'
1>readbits.cpp(45): error C2143: syntax error : missing ';' before '}'
1>readbits.cpp(45): error C2143: syntax error : missing ';' before ','
1>readbits.cpp(46): error C2143: syntax error : missing ';' before '{'
1>readbits.cpp(46): error C2143: syntax error : missing ';' before '}'
--------------------------------------------------------------------------------------------------------------------------------
ObjectConfig.cpp
1>objectconfig.hpp(15): error C2864: 'chilitags::MarkerConfig::size' : only static const integral data members can be initialized within a class
1>objectconfig.hpp(16): error C2059: syntax error : '{'
1>objectconfig.hpp(16): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>objectconfig.hpp(19): error C2059: syntax error : '{'
1>objectconfig.hpp(19): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>objectconfig.hpp(20): error C2864: 'chilitags::MarkerConfig::keep' : only static const integral data members can be initialized within a class
1>objectconfig.cpp(31): error C2039: 'translation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(32): error C2039: 'translation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(33): error C2039: 'translation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(34): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(35): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(36): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(86): warning C4305: 'initializing' : truncation from 'double' to 'const float'
1>objectconfig.cpp(98): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(99): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(100): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(101): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(102): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(103): error C2039: 'rotation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(106): error C3536: 'C': cannot be used before it is initialized
1>objectconfig.cpp(106): error C3536: 'E': cannot be used before it is initialized
1>objectconfig.cpp(106): error C3536: 'F': cannot be used before it is initialized
1>objectconfig.cpp(106): error C3536: 'D': cannot be used before it is initialized
1>objectconfig.cpp(106): error C2039: 'translation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(107): error C3536: 'B': cannot be used before it is initialized
1>objectconfig.cpp(107): error C3536: 'D': cannot be used before it is initialized
1>objectconfig.cpp(107): error C3536: 'E': cannot be used before it is initialized
1>objectconfig.cpp(107): error C3536: 'A': cannot be used before it is initialized
1>objectconfig.cpp(107): error C3536: 'F': cannot be used before it is initialized
1>objectconfig.cpp(107): error C3536: 'C': cannot be used before it is initialized
1>objectconfig.cpp(107): error C2039: 'translation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(108): error C3536: 'A': cannot be used before it is initialized
1>objectconfig.cpp(108): error C3536: 'D': cannot be used before it is initialized
1>objectconfig.cpp(108): error C3536: 'E': cannot be used before it is initialized
1>objectconfig.cpp(108): error C3536: 'B': cannot be used before it is initialized
1>objectconfig.cpp(108): error C3536: 'F': cannot be used before it is initialized
1>objectconfig.cpp(108): error C3536: 'C': cannot be used before it is initialized
1>objectconfig.cpp(108): error C2039: 'translation' : is not a member of 'chilitags::MarkerConfig'
1>          objectconfig.hpp(12) : see declaration of 'chilitags::MarkerConfig'
1>objectconfig.cpp(111): error C2059: syntax error : '{'
1>objectconfig.cpp(111): error C2143: syntax error : missing ';' before '}'
--------------------------------------------------------------------------------------------------------------------------------
Objects.cpp
1>objectconfig.hpp(15): error C2864: 'chilitags::MarkerConfig::size' : only static const integral data members can be initialized within a class
1>objectconfig.hpp(16): error C2059: syntax error : '{'
1>objectconfig.hpp(16): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>objectconfig.hpp(19): error C2059: syntax error : '{'
1>objectconfig.hpp(19): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>objectconfig.hpp(20): error C2864: 'chilitags::MarkerConfig::keep' : only static const integral data members can be initialized within a class
severin-lemaignan commented 10 years ago

Looks like Microsoft being late on C++11 support :-)

qbonnard commented 10 years ago

I'm sure Séverin will LOVE helping you fix that on windows/VS ;) As I told Mirko, maybe it would be wiser to use the big_refactoring branch if you're going to fight for the wiwin compilation. Did you run CMake with WITH_LSD on ? Or did you just shortcut cmake and make your own proj files ?

severin-lemaignan commented 10 years ago

<context> we have spend 15 min with @kshitijkshitij fighting with CMake on Windows, to eventually successfully generate a VS project that seems to be correct</context>

The actual issue is related to VS2012 not supporting initializer lists for vectors. The question then is: can we refrain to use them?

qbonnard commented 10 years ago

And use tons of push_back all over ? wel I guess we can... What branch are you on ? Maybe it's a small syntactic difference ? I remember one like that between gcc and clang. Have you tried variations like: std::vector blah = {0,1,2}; std::vector blah = {{0,1,2}}; std::vector blah{{0,1,2}}; std::vector blah({0,1,2}); std::vector blah({{0,1,2}}); ? http://i.imgur.com/xVyoSl.jpg

severin-lemaignan commented 10 years ago

Note that this bug does not appear with VS2013 + C++11. Should we mark VS2012 as not supported and close this issue?

qbonnard commented 10 years ago

Hum, tough one... I'm about as enthusiastic as you are to dumb down the code to support legacy proprietary software, but the poor windows people can't always upgrade that easily...

I guess it depends on the effort needed to support VS12. Would that be the only issue ? E.g. once we fix the brace initialisers, won't more c++11 pop up ? If not, it seems a good investment to fix these compilation errors, because the code changed quite a lot in the last 3 months and I think it went in favour of this issue (no more LSD, and some brace initialisations disappeared because of the use of Matx44). The big problem would rather be to find a volunteer equipped with VS12...

qbonnard commented 9 years ago

Okay, let's forget about non C++11 compilers... Welcome to 2014 ;)