Hello,

I started working again at a Qt project and upgraded it from Qt 5.2.1 to 5.4. Now I get very confusing compiler errors, when I build this project in Qt Creator. The project uses a C library called "libnova" and the MinGW (GCC 4.9.x) compiler from Qt 5.4 finds one of its header files quite offending. I didn't experience this issue when I last worked on that project. Compiling with Qt 5.3 or 5.2.1 kit yield the same results.
I am using the latest libnova code, as I contributed some fixes for Windows. I compiled the library (as before) with MinGW via MSYS.

Here's the compiler output:
Qt Code:
  1. 23:37:45: Running steps for project pyro...
  2. 23:37:45: Starting: "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" clean
  3. C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug clean
  4. mingw32-make[1]: Entering directory 'D:/Andreas/Qt/build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug'
  5. del debug\moc_mainwindow.cpp debug\moc_pyroengine.cpp debug\moc_imageanalysiswidget.cpp debug\moc_projectlistwidget.cpp debug\moc_skyobjectlistmodel.cpp debug\moc_miniatureoverlay.cpp debug\moc_imageloader.cpp
  6. D:\Andreas\Qt\build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug\debug\moc_mainwindow.cpp konnte nicht gefunden werden
  7. del ui_mainwindow.h ui_imageanalysiswidget.h ui_projectlistwidget.h
  8. del debug\main.o debug\mainwindow.o debug\pyromath.o debug\testcases.o debug\pyroengine.o debug\imageanalysiswidget.o debug\projectlistwidget.o debug\skyobjectlistmodel.o debug\miniatureoverlay.o debug\imageloader.o debug\moc_mainwindow.o debug\moc_pyroengine.o debug\moc_imageanalysiswidget.o debug\moc_projectlistwidget.o debug\moc_skyobjectlistmodel.o debug\moc_miniatureoverlay.o debug\moc_imageloader.o
  9. D:\Andreas\Qt\build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug\debug\main.o konnte nicht gefunden werden
  10. mingw32-make[1]: Leaving directory 'D:/Andreas/Qt/build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug'
  11. C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Release clean
  12. mingw32-make[1]: Entering directory 'D:/Andreas/Qt/build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug'
  13. del release\moc_mainwindow.cpp release\moc_pyroengine.cpp release\moc_imageanalysiswidget.cpp release\moc_projectlistwidget.cpp release\moc_skyobjectlistmodel.cpp release\moc_miniatureoverlay.cpp release\moc_imageloader.cpp
  14. D:\Andreas\Qt\build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug\release\moc_mainwindow.cpp konnte nicht gefunden werden
  15. del ui_mainwindow.h ui_imageanalysiswidget.h ui_projectlistwidget.h
  16. D:\Andreas\Qt\build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug\ui_mainwindow.h konnte nicht gefunden werden
  17. del release\main.o release\mainwindow.o release\pyromath.o release\testcases.o release\pyroengine.o release\imageanalysiswidget.o release\projectlistwidget.o release\skyobjectlistmodel.o release\miniatureoverlay.o release\imageloader.o release\moc_mainwindow.o release\moc_pyroengine.o release\moc_imageanalysiswidget.o release\moc_projectlistwidget.o release\moc_skyobjectlistmodel.o release\moc_miniatureoverlay.o release\moc_imageloader.o
  18. D:\Andreas\Qt\build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug\release\main.o konnte nicht gefunden werden
  19. mingw32-make[1]: Leaving directory 'D:/Andreas/Qt/build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug'
  20. 23:37:45: The process "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" exited normally.
  21. 23:37:45: Configuration unchanged, skipping qmake step.
  22. 23:37:45: Starting: "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe"
  23. C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug
  24. mingw32-make[1]: Entering directory 'D:/Andreas/Qt/build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug'
  25. C:\Qt\5.4\mingw491_32\bin\uic.exe ..\pyro\mainwindow.ui -o ui_mainwindow.h
  26. C:\Qt\5.4\mingw491_32\bin\uic.exe ..\pyro\imageanalysiswidget.ui -o ui_imageanalysiswidget.h
  27. C:\Qt\5.4\mingw491_32\bin\uic.exe ..\pyro\projectlistwidget.ui -o ui_projectlistwidget.h
  28. g++ -c -pipe -fno-keep-inline-dllexport -fopenmp -std=gnu++11 -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\pyro -I"..\..\..\Libraries\libnova-latest\src" -I"..\..\..\Libraries\Eigen3" -I"..\..\..\Libraries\ceres-solver-git\include" -I"..\..\..\Libraries\ceres-solver-git\internal\ceres\miniglog" -I"..\..\..\Libraries\ceres-solver-git\config" -I"C:\Qt\5.4\mingw491_32\include" -I"C:\Qt\5.4\mingw491_32\include\QtWidgets" -I"C:\Qt\5.4\mingw491_32\include\QtGui" -I"C:\Qt\5.4\mingw491_32\include\QtCore" -I"debug" -I"." -I"." -I"C:\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o debug\main.o ..\pyro\main.cpp
  29. In file included from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bits/gthr-default.h:35:0,
  30. from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bits/gthr.h:148,
  31. from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/ext/atomicity.h:35,
  32. from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h:39,
  33. from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/string:52,
  34. from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/random:40,
  35. from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/stl_algo.h:66,
  36. from C:/Qt/Tools/mingw491_32/i686-w64-mingw32/include/c++/algorithm:62,
  37. from C:\Qt\5.4\mingw491_32\include/QtCore/qglobal.h:81,
  38. from C:\Qt\5.4\mingw491_32\include/QtCore/qcoreapplication.h:37,
  39. from C:\Qt\5.4\mingw491_32\include\QtWidgets/qapplication.h:37,
  40. from C:\Qt\5.4\mingw491_32\include\QtWidgets/QApplication:1,
  41. from ..\pyro\main.cpp:1:
  42. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: expected unqualified-id before '{' token
  43. struct tm *gmtime_r (time_t *t, struct tm *gmt);
  44. ^
  45. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: expected ')' before '{' token
  46. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: expected primary-expression before 'struct'
  47. struct tm *gmtime_r (time_t *t, struct tm *gmt);
  48. ^
  49. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: expected '}' before 'struct'
  50. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: expected constructor, destructor, or type conversion before ';' token
  51. struct tm *gmtime_r (time_t *t, struct tm *gmt);
  52. ^
  53. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: '___tmp_tm' does not name a type
  54. struct tm *gmtime_r (time_t *t, struct tm *gmt);
  55. ^
  56. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: expected unqualified-id before 'if'
  57. struct tm *gmtime_r (time_t *t, struct tm *gmt);
  58. ^
  59. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: '___tmp_tm' does not name a type
  60. struct tm *gmtime_r (time_t *t, struct tm *gmt);
  61. ^
  62. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:230:12: error: expected unqualified-id before ')' token
  63. struct tm *gmtime_r (time_t *t, struct tm *gmt);
  64. ^
  65. In file included from ..\..\..\Libraries\libnova-latest\src/libnova/libnova.h:127:0,
  66. from ..\pyro\pyromath.h:6,
  67. from ..\pyro\pyroengine.h:16,
  68. from ..\pyro\mainwindow.h:10,
  69. from ..\pyro\main.cpp:3:
  70. ..\..\..\Libraries\libnova-latest\src/libnova/utility.h:258:1: error: expected declaration before '}' token
  71. };
  72. ^
  73. Makefile.Debug:2583: recipe for target 'debug/main.o' failed
  74. mingw32-make[1]: *** [debug/main.o] Error 1
  75. mingw32-make[1]: Leaving directory 'D:/Andreas/Qt/build-pyro-Desktop_Qt_5_4_0_MinGW_32bit-Debug'
  76. mingw32-make: *** [debug] Error 2
  77. makefile:34: recipe for target 'debug' failed
  78. 23:37:48: The process "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" exited with code 2.
  79. Error while building/deploying project pyro (kit: Desktop Qt 5.4.0 MinGW 32bit)
  80. When executing step "Make"
  81. 23:37:48: Elapsed time: 00:03.
To copy to clipboard, switch view to plain text mode 

You can see the libnova's header file "utility.h" here: http://sourceforge.net/p/libnova/lib...nova/utility.h

Honestly, I don't understand the compilers complaints. Most of the error messages do not seem to be related to the line declaring the gmtime_r() function. Can someone help, please?


Andreas