Results 1 to 9 of 9

Thread: Working project failing to build

  1. #1
    Join Date
    May 2014
    Posts
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Working project failing to build

    I am using Qt Creator to work on a project. Qt Creator is v3.1.2 based on Qt 5.3.1 (MSVC 2010, 32bit). After getting a significant part of the application coded and tested I was adding a couple of new modules. I started getting errors in Qt code!!! I have no idea what is causing it.

    So I decided to start a new project and add the old code one module at a time. I have a global header file that I use to define various structures that are passed between modules. I have not changed this module at all. It has been working fine up to this point.

    Here is the module:

    Qt Code:
    1. #ifndef GLOBAL_H
    2. #define GLOBAL_H
    3.  
    4. #include <QString>
    5.  
    6. struct _RoadsData {
    7. QString state;
    8. QString cnty;
    9. QString name;
    10. QString mtfcc;
    11. QString rttype;
    12. int roadtype;
    13. QString geometry;
    14. };
    15.  
    16. struct _ContourData {
    17. QString state;
    18. QString cnty;
    19. int type;
    20. QString geometry;
    21. };
    22.  
    23. struct _ImperviousData {
    24. QString state;
    25. QString cnty;
    26. int type;
    27. QString geometry;
    28. };
    29.  
    30. struct _AreaObjectsData {
    31. QString state;
    32. QString cnty;
    33. int type;
    34. QString name;
    35. QString geometry;
    36. };
    37.  
    38. struct _ParcelData {
    39. QString state;
    40. QString cnty;
    41. QString address;
    42. QString geometry;
    43. };
    44.  
    45. struct _PointObjectsData {
    46. QString state;
    47. QString cnty;
    48. int type;
    49. QString name;
    50. QString geometry;
    51. };
    52.  
    53. struct _AddrPointData {
    54. QString state;
    55. QString cnty;
    56. int stnbr;
    57. QString geometry;
    58. };
    59.  
    60.  
    61. Q_DECLARE_METATYPE(_RoadsData)
    62. Q_DECLARE_METATYPE(_ContourData)
    63. Q_DECLARE_METATYPE(_ParcelData)
    64. Q_DECLARE_METATYPE(_AddrPointData)
    65. Q_DECLARE_METATYPE(_ImperviousData)
    66. Q_DECLARE_METATYPE(_AreaObjectsData)
    67. Q_DECLARE_METATYPE(_PointObjectsData)
    68. #endif // GLOBAL_H
    To copy to clipboard, switch view to plain text mode 
    The project builds clean if I haven't yet used this file. As soon as I include it in a module I get the following error for each of the declares:

    C3646: 'Q_DECLARE_METATYPE' : unknown override specifier
    I also get
    C2091: function returns function
    in global.h

    Also I get a bunch of errors in iterator and xfunctional.

    In searching this error I found a suggestion that I put in an include for QMetaType. (It worked fine before this without that include.) I put it in. The errors went away in global.h. But now I'm getting errors in iterator, qlist.h, qscopedpointer.h and qobject_impl.h.

    I don't know what to do!!! Please help.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Working project failing to build

    What Qt version and Microsoft Visual C++ compiler version are you using to build your project? This is not the same thing as the compiler and Qt version used to build Qt Creator.

    Do you have C++11 options in your PRO file? "override" is a C++11 specifier.

    It would generally help if you published the entire compiler output providing context to the warning/error message.

    The C++ specification reserves identifier names starting with an underscore and upper-case letter (or just an underscore in global scope, or two underscores anywhere in the identifier) for the compiler implementation. You are using these for your struct type names, and this may be causing an issue.
    http://stackoverflow.com/questions/2...a-c-identifier

  3. #3
    Join Date
    May 2014
    Posts
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Working project failing to build

    Quote Originally Posted by ChrisW67 View Post
    What Qt version and Microsoft Visual C++ compiler version are you using to build your project? This is not the same thing as the compiler and Qt version used to build Qt Creator.

    Do you have C++11 options in your PRO file? "override" is a C++11 specifier.

    It would generally help if you published the entire compiler output providing context to the warning/error message.

    The C++ specification reserves identifier names starting with an underscore and upper-case letter (or just an underscore in global scope, or two underscores anywhere in the identifier) for the compiler implementation. You are using these for your struct type names, and this may be causing an issue.
    http://stackoverflow.com/questions/2...a-c-identifier
    I am using Microsoft Windows SDK for Windows 7(7.1.7600.0.30514)(x86) as the compiler. I have QT v5.3.1 32-bit installed.

    I do not have C++11 activated. I tried turning it on a few weeks ago and received an error. (CONFIG += c++11)

    I changed the struct names and still receive the same errors.

    I have been using this configuration for over a year now and started the current project about 2 months ago. The code as listed above has compiled fine until late last week. All I did was add a new class to the project.


    Added after 4 minutes:


    The error output is too long to post in one reply. Here is part 1:

    10:33:26: Running steps for project AddProcessing...
    10:33:26: Starting: "C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\qmake.e xe" C:\Qt-Projects\CarmentaProjects\AddProcessing\AddProcess ing.pro -r -spec win32-msvc2010 "CONFIG+=debug"
    10:33:27: The process "C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\qmake.e xe" exited normally.
    10:33:27: Starting: "C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe"
    C:\Qt\Qt5.3.1\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
    C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\uic.exe ..\..\..\Qt-Projects\CarmentaProjects\AddProcessing\mainwindow .ui -o ui_mainwindow.h
    C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\uic.exe ..\..\..\Qt-Projects\CarmentaProjects\AddProcessing\processpro jectinput.ui -o ui_processprojectinput.h
    C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\moc.exe -DUNICODE -DWIN32 -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1600 -D_WIN32 -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/mkspecs/win32-msvc2010 -IC:/Qt-Projects/CarmentaProjects/AddProcessing -IC:/Progra~2/Carmenta/Carmen~1/include -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtMultimediaWidgets -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtOpenGL -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtMultimedia -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtWidgets -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtSql -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtNetwork -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtGui -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtCore -I. ..\..\..\Qt-Projects\CarmentaProjects\AddProcessing\mainwindow .h -o debug\moc_mainwindow.cpp
    cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\AddProcessing.pdb -DUNICODE -DWIN32 -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"..\..\..\Progra~2\Carmenta\Carmen~1\include" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\inclu de" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimediaWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtOpenGL" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimedia" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtSql" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtNetwork" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtGui" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\mkspecs\ win32-msvc2010" -Fodebug\ @C:\Users\GLENNP~1\AppData\Local\Temp\main.obj.621 6.16.jom
    C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\rcc.exe -name resources ..\..\..\Qt-Projects\CarmentaProjects\AddProcessing\resources. qrc -o debug\qrc_resources.cpp
    main.cpp
    C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\moc.exe -DUNICODE -DWIN32 -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1600 -D_WIN32 -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/mkspecs/win32-msvc2010 -IC:/Qt-Projects/CarmentaProjects/AddProcessing -IC:/Progra~2/Carmenta/Carmen~1/include -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtMultimediaWidgets -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtOpenGL -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtMultimedia -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtWidgets -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtSql -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtNetwork -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtGui -IC:/Qt/Qt5.3.1/5.3/msvc2010_opengl/include/QtCore -I. ..\..\..\Qt-Projects\CarmentaProjects\AddProcessing\processpro jectinput.h -o debug\moc_processprojectinput.cpp
    cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\AddProcessing.pdb -DUNICODE -DWIN32 -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"..\..\..\Progra~2\Carmenta\Carmen~1\include" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\inclu de" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimediaWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtOpenGL" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimedia" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtSql" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtNetwork" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtGui" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\mkspecs\ win32-msvc2010" -Fodebug\ @C:\Users\GLENNP~1\AppData\Local\Temp\processproje ctinput.obj.6216.78.jom
    processprojectinput.cpp
    cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\AddProcessing.pdb -DUNICODE -DWIN32 -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"..\..\..\Progra~2\Carmenta\Carmen~1\include" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\inclu de" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimediaWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtOpenGL" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimedia" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtSql" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtNetwork" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtGui" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\mkspecs\ win32-msvc2010" -Fodebug\ @C:\Users\GLENNP~1\AppData\Local\Temp\mainwindow.o bj.6216.250.jom
    mainwindow.cpp
    cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc /Fddebug\AddProcessing.pdb -DUNICODE -DWIN32 -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"..\..\..\Progra~2\Carmenta\Carmen~1\include" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\inclu de" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimediaWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtOpenGL" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtMultimedia" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtWidgets" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtSql" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtNetwork" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtGui" -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\ QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.3.1\5.3\msvc2010_opengl\mkspecs\ win32-msvc2010" -Fodebug\ @C:\Users\GLENNP~1\AppData\Local\Temp\qrc_resource s.obj.6216.328.jom
    qrc_resources.cpp
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(61) : error C2143: syntax error : missing ';' before '<'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(61) : error C2059: syntax error : '<'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(61) : error C2065: '_Container' : undeclared identifier
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(62) : error C2059: syntax error : 'public'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(203) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(204) : error C2238: unexpected token(s) preceding ';'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(205) : error C2059: syntax error : '<'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(206) : error C2238: unexpected token(s) preceding ';'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(207) : error C2059: syntax error : '<'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(208) : error C2238: unexpected token(s) preceding ';'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(210) : error C2143: syntax error : missing ';' before '&&'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(210) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    jom: C:\Qt-Testing\Carmenta\AddProcessing\Makefile.Debug [debug\processprojectinput.obj] Error 2
    Error output Part 2:

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(210) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(240) : error C2143: syntax error : missing ';' before '*'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(240) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(241) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(284) : error C2061: syntax error : identifier 'difference_type'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(285) : error C2805: binary 'operator +=' has too few parameters
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(285) : error C2333: 'Loadfiles::std::move_iterator<_RanIt>:perator +=' : error in function declaration; skipping function body
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(290) : error C2061: syntax error : identifier 'difference_type'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(295) : error C2061: syntax error : identifier 'difference_type'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(296) : error C2805: binary 'operator -=' has too few parameters
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(296) : error C2333: 'Loadfiles::std::move_iterator<_RanIt>:perator -=' : error in function declaration; skipping function body
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(301) : error C2061: syntax error : identifier 'difference_type'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(306) : error C2143: syntax error : missing ';' before '['
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(306) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(306) : error C2061: syntax error : identifier 'difference_type'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(307) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(307) : error C2805: binary 'operator [' has too few parameters
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(307) : error C2333: 'Loadfiles::std::move_iterator<_RanIt>:perator []' : error in function declaration; skipping function body
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(317) : error C2143: syntax error : missing ';' before '-'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(317) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(318) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(419) : error C2143: syntax error : missing ',' before '<'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(476) : see reference to class template instantiation 'Loadfiles::std::istream_iterator<_Ty,_Elem,_Trait s,_Diff>' being compiled
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(426) : error C2143: syntax error : missing ';' before '<'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(426) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(426) : error C2238: unexpected token(s) preceding ';'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(433) : error C2061: syntax error : identifier 'istream_type'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(433) : error C2535: 'Loadfiles::std::istream_iterator<_Ty,_Elem,_Trait s,_Diff>::istream_iterator(void)' : member function already defined or declared
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(428) : see declaration of 'Loadfiles::std::istream_iterator<_Ty,_Elem,_Trait s,_Diff>::istream_iterator'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(474) : error C2143: syntax error : missing ';' before '*'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(474) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(474) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(521) : error C2143: syntax error : missing ';' before '<'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(555) : see reference to class template instantiation 'Loadfiles::std:stream_iterator<_Ty,_Elem,_Traits>' being compiled
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(521) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(521) : error C2238: unexpected token(s) preceding ';'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(523) : error C2061: syntax error : identifier 'ostream_type'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(554) : error C2143: syntax error : missing ';' before '*'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(554) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(554) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    I appologize for the posts. It keeps repeating every time I post. There is more to the output but I don't want to mess up this subject.
    Last edited by gpuckett; 8th June 2015 at 15:51.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Working project failing to build

    The first error comes from trying to compile the generated C++ code for the embedded resources qrc_resources.cpp. This code should not contain any reference to any of your headers. If you have not done so already delete your shadow build directory and rebuild.

  5. #5
    Join Date
    May 2014
    Posts
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Working project failing to build

    Quote Originally Posted by ChrisW67 View Post
    The first error comes from trying to compile the generated C++ code for the embedded resources qrc_resources.cpp. This code should not contain any reference to any of your headers. If you have not done so already delete your shadow build directory and rebuild.
    I have to delete the build directory and pro.user file every time I do a build or I can't get a clean compile. Is that what you mean? That's a real hassle with the Qt Creator IDE.

    I tried it again with no change.


    Added after 14 minutes:


    I decided to delete and rebuild the resources definitions. Deleted the build directory and the pro.user file and did a new build. Same errors.


    Added after 7 minutes:


    I was doing great to meet a deadline next week. Now I've been stopped dead for 4 days. Sheesh this is frustrating. I have seen similar sorts of results before. At the time it turned out I had missed a dependent include or had a few mistakes in the code. In this case I have built a very small piece of the application and gone through it closely to try to find anything wrong. I just can't. Doesn't mean I DON'T have a mistake, I just can't find it.

    It is still the case that if I remove the include for global.h it builds just fine. I'm going to try to do something different with global.h. Anything to get past this. It was just extremely convenient to define these structures in one header file that I could share between other modules. I'm a great believer in the write once and reuse policy.

    As you can probably obviously tell I'm not an experienced C++ programmer. I've been working on this project for almost a year but it's still just what I've learned with Qt and C++ to get the job done. I still struggle with a lot of concepts. I'm actually a java developer. Lots of stuff to really twist one's mind between the two!!!
    Last edited by gpuckett; 9th June 2015 at 19:44.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Working project failing to build

    It may be a red herring, but the filename "global.h" could be the cause of the problem all by itself. If there happens to be another file of the same name somewhere on the include path, it might be getting picked up instead. Try changing the name to something a bit more uncommon maybe? Or changing the #ifndef GLOBAL_H to something a bit more unlikely to be the same as a #define elsewhere?

  7. #7
    Join Date
    May 2014
    Posts
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Working project failing to build

    Quote Originally Posted by d_stranz View Post
    It may be a red herring, but the filename "global.h" could be the cause of the problem all by itself. If there happens to be another file of the same name somewhere on the include path, it might be getting picked up instead. Try changing the name to something a bit more uncommon maybe? Or changing the #ifndef GLOBAL_H to something a bit more unlikely to be the same as a #define elsewhere?
    I really hoped that would work. So I changed it to myglobal.h. Rebuild with over 100 errors as before.


    Added after 26 minutes:


    Making progress. Added namespace around the structs in myglobal.h. Now I can include the header and not get a lot of errors. But it causes problems with other classes in other namespaces. Looks like I'm closer. Just have to figure out how to apply the namespace properly. putting structs in namespace may be more complicated than I've understand just yet. That's what Google is for, right?
    Last edited by gpuckett; 11th June 2015 at 17:37.

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Working project failing to build

    You should not have to do that. There's something we're all missing here, and it is likely one of those things that's been staring you in the face the whole time. Like a missing piece of punctuation or something stupid like that.

    You may be able to avoid some of the other compilation errors by putting a "using namespace xyz;" declaration at the top of C++ or other files that use these classes. But it just screams "kludge!".

  9. #9
    Join Date
    May 2014
    Posts
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Working project failing to build

    I finally resolved the problem. There was an unclosed bracket on a namespace definition somewhere else in my code. I think I understand why this happened from a C++ perspective but I still find the resulting errors frustrating. This is one of those things where C++ is tremendously different from Java. I looked at that code for hours. Just couldn't see the problem. I want to say thank you to everyone who responded. I admitted up front that I had already assumed it was a stupid mistake. Maybe it's just Qt Creator but the volume and sheer complexity of the resulting errors just led me EVERY WERE else but where the actual error occurred. I am so familiar with the way the Eclipse IDE emphasizes open and closed parens and brackets it is difficult to identify missing ones easily.

    I apologize for wasting your time.

    How do I mark this thread as resolved?

Similar Threads

  1. Can't build a sample project
    By gpuckett in forum Newbie
    Replies: 3
    Last Post: 5th May 2014, 00:17
  2. I am working on a POS project
    By foxrider in forum Newbie
    Replies: 12
    Last Post: 21st April 2014, 14:48
  3. Error on try to build a project example.
    By radialdeveloper in forum Newbie
    Replies: 1
    Last Post: 25th May 2013, 22:38
  4. Shadow build of Qt 4.7.4 failing due to syncqt not running
    By robini in forum Installation and Deployment
    Replies: 3
    Last Post: 22nd February 2012, 12:11
  5. Cant build Qt project
    By ChrisBuchholz in forum Installation and Deployment
    Replies: 7
    Last Post: 20th July 2010, 23:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.