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. Qt with VS 2013
Qt 6.11 is out! See what's new in the release blog

Qt with VS 2013

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.8k Views 1 Watching
  • 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.
  • P Offline
    P Offline
    Papa
    wrote on last edited by
    #1

    Using this code:

    using LISTSTR = std::list< std::wstring>;
    

    I am getting these errors

    error: C2143: syntax error : missing ';' before '='
    error: C2873: 'LISTSTR' : symbol cannot be used in a using-declaration
    error: C2513: 'int' : no variable declared before '='

    This code compiles without any problems under VS2015/13

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @Papa said:

      using LISTSTR = std::list< std::wstring>;

      Type alias declarations are C++11 features. C++11 is not (yet) enabled by default, so you have to turn it on by adding the following to your *.pro file: CONFIG += c++11

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Papa
        wrote on last edited by
        #3

        Qt Creator added that line in the .pro file.
        In my code I added

        #if ((_MSC_VER >= 1600) || (GCC_VERSION >= 40902))  //if C++11
            using LISTSTR = std::list< std::wstring>;
        #else
        	typedef std::list< std::string > LISTSTR;
        #endif
        

        The Creator Intelisence recognized the the statement with the 'using' key-word, but the compiler does not and issues a error message.

        1 Reply Last reply
        0
        • jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0

          • Login

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