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. Qlist error on windows
Forum Updated to NodeBB v4.3 + New Features

Qlist error on windows

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 4.3k 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    Hi,

    I am trying to move a qt project from linux to windows. Although my application compiles and runs on linux, when compiling on windows I get a bunch of really ugly errors (below). I appreciate any ideas on how to solve or debug this problem.

    Thanks.

    Here are the errors:
    C:\QtSDK\QtCreator\bin\jom.exe -nologo -j 8 -f Makefile.Debug cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtGui" -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtOpenGL" -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include" -I"C:\Users\ethan\Documents\Visual Studio 2010\Projects\IGLU" -I"c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\ActiveQt" -I"debug" -I"." -I"..\BasicOGL" -I"." -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\win32-msvc2010" -Fodebug\ @C:\Users\ethan\AppData\Local\Temp\main.obj.4320.16.jom
    main.cpp
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(345) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(361) : see reference to class template instantiation 'QList<T>' being compiled
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(345) : error C2143: syntax error : missing ',' before '<'
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(347) : error C2143: syntax error : missing ';' before '<'
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(347) : error C2433: 'QList<T>::list' : 'inline' not permitted on data declarations
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(347) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(348) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qlist.h(345) : error C2039: 'list' : is not a member of 'std'
    c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore/qobject.h(93) : see reference to class template instantiation 'QList<T>' being compiled with
    [
    T=QObject *
    ]

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      How does the code look like?

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        The errors were caused by this chunk of code in qlist.h:
        @
        #ifndef QT_NO_STL
        static inline QList<T> fromStdList(const std::list<T> &list)
        { QList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
        inline std::list<T> toStdList() const
        { std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
        #endif
        @
        So I seem to have resolved the problem by defining QT_NO_STL in my .pro file. Since I do not use anything from the STL this is not an issue. However, its silly that the compilation of internal qt headers would be inconsistent between Windows / Linux. I'd appreciate further explanation of what exactly the above errors mean.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          franku
          wrote on last edited by
          #4

          What about your code?

          This, Jen, is the internet.

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            If I knew what code of my was causing this problem then I would have some idea of how to solve it.
            But I have no idea what is causing this error as the compiler errors refer only to qlist.h.

            Any suggestions on how to find which parts of my code cause the error?

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MuldeR
              wrote on last edited by
              #6

              From experience, if something goes wrong in a third-party header file you include, then it's quite often a mistake in your own code before the #include statement, maybe indirectly through another #include statement.

              You could try something very simple like:
              @//Test.cpp
              #include <QList>

              int myTest(void)
              {
              QList<int> test;
              test << 42;
              return test.size();
              }@

              If a file with only that content won't compile either, it would indicate that something with your build environment and/or your Qt configuration is wrong. If it does compile fine, then carefully check your other code again. In particular, I would try to strip down your code as much as possible, until it compiles through. Then re-add the code line-by-line until it fails to compile again, so you will find the "problematic" part...

              My OpenSource software at: http://muldersoft.com/

              Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

              Go visit the coop: http://youtu.be/Jay...

              1 Reply Last reply
              0
              • T Offline
                T Offline
                tobias.hunger
                wrote on last edited by
                #7

                When I get errors like this it is my code causing it in about 99.9% of all cases. So what does your code look like? It seems to be compiling main.cpp when triggering those errors.

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  franku
                  wrote on last edited by
                  #8

                  How did you initialize your QList object? If you need help, provide some of your coude where the QList is used. Probably it's not a Qt issue but a C++ one.

                  This, Jen, is the internet.

                  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