Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Qt with VS 2013

    General and Desktop
    3
    4
    722
    Loading More Posts
    • 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
      Papa last edited by

      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 Reply Quote 0
      • ?
        A Former User last edited by

        @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 Reply Quote 0
        • P
          Papa last edited by

          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 Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • First post
              Last post