"New Class Form" does not name a type
-
The Error you show is completely elsewhere from what you have shown us...
-
@Christian-Ehrlicher I've shared the whole project above. I don't understand why the error if I added just the definition of the new class variable created by the IDE.
-
@Andrew23 said in "New Class Form" does not name a type:
I've shared the whole project above.
Then how come the error message tells you the error comes in file
..\Graphity\graphity.h
, which you do not show? As you can see, that file appears to referenceUpdateWindow
, in a line similar to the one you show inmainwindow.h
but not the same file? -
@JonB said in "New Class Form" does not name a type:
Then how come the error message tells you the error comes in file ..\Graphity\graphity.h, which you do not show? As you can see, that file appears to reference UpdateWindow, in a line similar to the one you show in mainwindow.h but not the same file?
Sorry but I've create confusion changing the class name in this post. Mea culpa!
I'll edit the original post with the actual code. Anyway you can check the entire project here. -
@Andrew23 have you actually run qmake(explicitly), since adding the UI-Form to the project ?
Because I cloned your project and after stripping qcustomplot from it ( Could not be bothered to manually get the library myself) it compiles just fine. (macOS Qt 6.5)
-
@JonB said in "New Class Form" does not name a type:
I assume you have allowed moc to run on the .ui file to regenerate the ui_updatewindow.h file. You might delete all intermediate files and redo the build completely from scratch to make sure everything is up to date.
-
@JonB said in "New Class Form" does not name a type:
You might delete all intermediate files and redo the build completely from scratch to make sure everything is up to date.
Can you are more specific? I'm newbie with Qt. What are intermediate files? I deleted the build directory but te error persists.
-
@J-Hilk said in "New Class Form" does not name a type:
@Andrew23 have you actually run qmake(explicitly), since adding the UI-Form to the project ?
I didn't change nothing in project settings since I started. If I remove the updatewindow UI-Form it compiles, if I add it than fails.
-
@J-Hilk said in "New Class Form" does not name a type:
run qmake and or rebuild/clean are 99% of the time fine for a "clean rebuild"
I run qmake and the output is
14:23:19: Running steps for project Graphity... 14:23:19: Starting: "C:\Qt\6.4.3\mingw_64\bin\qmake.exe" D:\Documenti\Qt\Graphity\Graphity\Graphity.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" 14:23:21: The process "C:\Qt\6.4.3\mingw_64\bin\qmake.exe" exited normally. 14:23:21: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -f D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug/Makefile qmake_all mingw32-make: Nothing to be done for 'qmake_all'. 14:23:21: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally. 14:23:21: Elapsed time: 00:02.
Then I run rebuild and the output shows error again:
14:24:09: Running steps for project Graphity... 14:24:09: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" clean -j12 C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Debug clean C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Release clean mingw32-make[1]: Entering directory 'D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug' del debug\qrc_assets.cpp mingw32-make[1]: Entering directory 'D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug' del release\qrc_assets.cpp del debug\moc_predefs.h del release\moc_predefs.h Impossibile trovare D:\Documenti\Qt\Graphity\build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug\release\qrc_assets.cpp del release\moc_graphity.cpp release\moc_logswindow.cpp release\moc_serialconnection.cpp release\moc_updatewindow.cpp del debug\moc_graphity.cpp debug\moc_logswindow.cpp debug\moc_serialconnection.cpp debug\moc_updatewindow.cpp Impossibile trovare D:\Documenti\Qt\Graphity\build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug\release\moc_predefs.h del ui_graphity.h ui_logswindow.h ui_updatewindow.h del ui_graphity.h ui_logswindow.h ui_updatewindow.h Impossibile trovare D:\Documenti\Qt\Graphity\build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug\release\moc_graphity.cpp del release\logswindow.o release\main.o release\graphity.o release\serialconnection.o release\updatewindow.o release\qrc_assets.o release\moc_graphity.o release\moc_logswindow.o release\moc_serialconnection.o release\moc_updatewindow.o del debug\logswindow.o debug\main.o debug\graphity.o debug\serialconnection.o debug\updatewindow.o debug\qrc_assets.o debug\moc_graphity.o debug\moc_logswindow.o debug\moc_serialconnection.o debug\moc_updatewindow.o mingw32-make[1]: Leaving directory 'D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug' Impossibile trovare D:\Documenti\Qt\Graphity\build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug\release\logswindow.o mingw32-make[1]: Leaving directory 'D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug' 14:24:10: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally. 14:24:10: Starting: "C:\Qt\6.4.3\mingw_64\bin\qmake.exe" D:\Documenti\Qt\Graphity\Graphity\Graphity.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" 14:24:11: The process "C:\Qt\6.4.3\mingw_64\bin\qmake.exe" exited normally. 14:24:11: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -f D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug/Makefile qmake_all mingw32-make: Nothing to be done for 'qmake_all'. 14:24:11: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally. 14:24:11: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -j12 C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug' C:\Qt\6.4.3\mingw_64\bin\uic.exe ..\Graphity\graphity.ui -o ui_graphity.h C:\Qt\6.4.3\mingw_64\bin\uic.exe ..\Graphity\logswindow.ui -o ui_logswindow.h C:\Qt\6.4.3\mingw_64\bin\uic.exe ..\Graphity\updatewindow.ui -o ui_updatewindow.h g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\main.o ..\Graphity\main.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\serialconnection.o ..\Graphity\serialconnection.cpp C:\Qt\6.4.3\mingw_64\bin\rcc.exe -name assets --no-zstd ..\Graphity\assets.qrc -o debug\qrc_assets.cpp g++ -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -dM -E -o debug\moc_predefs.h C:\Qt\6.4.3\mingw_64\mkspecs\features\data\dummy.cpp C:\Qt\6.4.3\mingw_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug/debug/moc_predefs.h -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -ID:/Documenti/Qt/Graphity/Graphity -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -I. -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IC:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/include ..\Graphity\graphity.h -o debug\moc_graphity.cpp C:\Qt\6.4.3\mingw_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug/debug/moc_predefs.h -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -ID:/Documenti/Qt/Graphity/Graphity -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -I. -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IC:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/include ..\Graphity\logswindow.h -o debug\moc_logswindow.cpp C:\Qt\6.4.3\mingw_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug/debug/moc_predefs.h -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -ID:/Documenti/Qt/Graphity/Graphity -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -I. -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IC:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/include ..\Graphity\serialconnection.h -o debug\moc_serialconnection.cpp C:\Qt\6.4.3\mingw_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug/debug/moc_predefs.h -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -ID:/Documenti/Qt/Graphity/Graphity -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -I. -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IC:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/include ..\Graphity\updatewindow.h -o debug\moc_updatewindow.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\updatewindow.o ..\Graphity\updatewindow.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\qrc_assets.o debug\qrc_assets.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\logswindow.o ..\Graphity\logswindow.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\graphity.o ..\Graphity\graphity.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\moc_logswindow.o debug\moc_logswindow.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\moc_serialconnection.o debug\moc_serialconnection.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\moc_updatewindow.o debug\moc_updatewindow.cpp g++ -c -fno-keep-inline-dllexport -Wa,-mbig-obj -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQCUSTOMPLOT_USE_LIBRARY -DQT_QML_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Graphity -I. -IC:/Qt/6.4.3/mingw_64/include -IC:/Qt/6.4.3/mingw_64/include/QtPrintSupport -IC:/Qt/6.4.3/mingw_64/include/QtWidgets -IC:/Qt/6.4.3/mingw_64/include/QtGui -IC:/Qt/6.4.3/mingw_64/include/QtSerialPort -IC:/Qt/6.4.3/mingw_64/include/QtCore -Idebug -I. -I/include -IC:/Qt/6.4.3/mingw_64/mkspecs/win32-g++ -o debug\moc_graphity.o debug\moc_graphity.cpp In file included from ..\Graphity\main.cpp:1: ..\Graphity\graphity.h:119:5: error: 'UpdateWindow' does not name a type 119 | UpdateWindow *updateWindow = nullptr; | ^~~~~~~~~~~~ In file included from ..\Graphity\graphity.cpp:2: ..\Graphity\graphity.h:119:5: error: 'UpdateWindow' does not name a type 119 | UpdateWindow *updateWindow = nullptr; | ^~~~~~~~~~~~ mingw32-make[1]: *** [Makefile.Debug:2378: debug/main.o] Error 1 mingw32-make[1]: *** Waiting for unfinished jobs.... In file included from debug\moc_graphity.cpp:10: debug\../../Graphity/graphity.h:119:5: error: 'UpdateWindow' does not name a type 119 | UpdateWindow *updateWindow = nullptr; | ^~~~~~~~~~~~ mingw32-make[1]: *** [Makefile.Debug:2930: debug/graphity.o] Error 1 mingw32-make[1]: Leaving directory 'D:/Documenti/Qt/Graphity/build-Graphity-Desktop_Qt_6_4_3_MinGW_64_bit-Debug' mingw32-make[1]: *** [Makefile.Debug:3368: debug/moc_graphity.o] Error 1 mingw32-make: *** [Makefile:45: debug] Error 2 14:24:23: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project Graphity (kit: Desktop Qt 6.4.3 MinGW 64-bit) When executing step "Make" 14:24:23: Elapsed time: 00:14.
-
@Andrew23
In Qt Creator edit thegraphity.h
file. Go to the119 | UpdateWindow *updateWindow = nullptr;
line. Right-click on
UpdateWindow
there. Can you "Go to declaration/definition" from that symbol?This may well be a red-herring. But you are Windows, and Windows SDK has an
UpdateWindow
global function. I don't know what files Qt includes in its headers which goes into your sources, but ifwindows.h
or similar gets exported into yours it's just possible it might be picking that up. -
@JonB said in "New Class Form" does not name a type:
Right-click on UpdateWindow there. Can you "Go to declaration/definition" from that symbol?
In the right click menu there isn't "Go to declaration/definition", but if I use CTRL+Lmouse it brings me to the definition in the updatewinfow.h file. If I pass on it with mouse I get
-
@Andrew23
That's like I said then! It has indeed found the function namedUpdateWindow()
inwinuser.h
, a Windows SDK header file. And it tells you that is hiding the classUpdateWindow
you want it to pick up.You can wait for some C++ guru to suggest your best move. But one thing would work: completely delete your
UpdateWindow
class and pick some other name for it! Make sure you rebuild from scratch when you do so.Oh, for this error it tells you what you can do here:
class UpdateWindow *updateWindow = nullptr;
It even says you can click the message to make it do it for you.... I don't know if there will be other similar issues elsewhere, you will always have to use
class UpdateWindow ...
, might be simpler to rename your class.