Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compilation errors (OpenCV)
Forum Updated to NodeBB v4.3 + New Features

Compilation errors (OpenCV)

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 199 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kapabahwuk
    wrote on last edited by
    #1

    Just reinstalled QT and compiled all libs, but could not compile previous working version:
    Initializing:
    std::vector<std::vectorcv::Point > test {{ { 52 , 2 } , { 51 , 3 };

    Errors:

    C:\Users\66820\Documents\capture\main.cpp:16: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
    std::vector<std::vectorcv::Point > test {{ { 52 , 2 } , { 51 , 3 } ,{ 50 , 3 } , { 49 , 3 } ,{ 48 , 3 } ,{ 47 , 3 } ,{ 46 , 3 } ,{ 45 , 3 } ,{ 44 , 3 } ,{ 43 , 3 } ,{ 42 , 3 } ,{ 41 , 3 } ,{ 40 , 4 } ,{ 39 , 4 } ,{ 38 , 4 } ,{ 37 , 4 } ,{ 36 , 4 } ,{ 35 , 4 } ,{ 34 , 4 } ,{ 33 , 4 } ,{ 32 , 5 } ,{ 31 , 5 } ,{ 30 , 6 } ,{ 29 , 6 } ,{ 28 , 6 } ,{ 27 , 7 } ,{ 26 , 7 } ,{ 25 , 7 } ,{ 24 , 8 }}};

    In c++98 must be initialized by constructor, not by '{...}'
    how to fix these?

    C:\Users\66820\Documents\capture\main.cpp:16: error: no matching function for call to 'std::vector<std::vector<cv::Point_<int> > >::vector(<brace-enclosed initializer list>)'

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kapabahwuk
      wrote on last edited by
      #2

      Got clue from open cv forum, they told me I do need to add -std=c++11 to compiler cmdline.
      How can I amend pro file accordingly?

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        Something like this:

        # With C++11 support
        greaterThan(QT_MAJOR_VERSION, 4){    
        CONFIG += c++11
        } else {
        QMAKE_CXXFLAGS += -std=c++11
        }
        
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved