QtCreator demands iostream.h
-
After complete new installation of Qt Creator 10 and Qt 6.5 on Windows11 I started a new widget project. Not changing any proposed name or file or folder. After setup of the projects by Qt I immediately tried to compile and got an error telling me
"/include/iterator:37:10: fatal error: iostream.h: no such file or directory"
In the error message "/include/iterator:37:10:" is a link (underlined) but when I click it an error occurs:" The binary editor cannot open empty files"
However, found only one file on the entire hard drive having a line "#include <iostream.h" (etip.h in the ncursesw folder)
Did not find any file named "iterator" (there are sub-directories, though)
Who in the Qt-System is still using "iostream.h"???
I am surely not the super professional in Qt but this seems very strange to my??? -
After complete new installation of Qt Creator 10 and Qt 6.5 on Windows11 I started a new widget project. Not changing any proposed name or file or folder. After setup of the projects by Qt I immediately tried to compile and got an error telling me
"/include/iterator:37:10: fatal error: iostream.h: no such file or directory"
In the error message "/include/iterator:37:10:" is a link (underlined) but when I click it an error occurs:" The binary editor cannot open empty files"
However, found only one file on the entire hard drive having a line "#include <iostream.h" (etip.h in the ncursesw folder)
Did not find any file named "iterator" (there are sub-directories, though)
Who in the Qt-System is still using "iostream.h"???
I am surely not the super professional in Qt but this seems very strange to my???@rhnulm
Can you copy & paste the (whole of the) actual compiler output you should find in the Complier Output pane in Creator, in case there is some more information there about where this is being called from.You probably have two
.cpp
files, something likemain.cpp
&widget.cpp
? Which of these is it compiling when you get the error? You could show whichever one's contents. -
@rhnulm
Can you copy & paste the (whole of the) actual compiler output you should find in the Complier Output pane in Creator, in case there is some more information there about where this is being called from.You probably have two
.cpp
files, something likemain.cpp
&widget.cpp
? Which of these is it compiling when you get the error? You could show whichever one's contents.@JonB
The error message is:
In file included from C:/Qt/6.5.0/mingw_64/include/QtCore/qcontainertools_impl.h:20,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qarraydataops.h:9,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qarraydatapointer.h:7,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qbytearray.h:11,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qstringview.h:8,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qchar.h:656,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qstring.h:14,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qobject.h:11,
from C:/Qt/6.5.0/mingw_64/include/QtWidgets/qwidget.h:9,
from C:/Qt/6.5.0/mingw_64/include/QtWidgets/qmainwindow.h:8,
from C:/Qt/6.5.0/mingw_64/include/QtWidgets/QMainWindow:1,
from debug../../untitled2/mainwindow.h:4,
from debug\moc_mainwindow.cpp:9:
/include/iterator:37:10: fatal error: iostream.h: No such file or directory
37 | #include <iostream.h>
| ^~~~~~~~~~~~
The same message occurs for main.cpp and for mainwindow.hThe sources are entirely untouched:
main.cpp
#include "mainwindow.h"#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACEclass MainWindow : public QMainWindow
{
Q_OBJECTpublic:
MainWindow(QWidget *parent = nullptr);
~MainWindow();private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_Hmainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}MainWindow::~MainWindow()
{
delete ui;
}No clue what else to look???
-
@JonB
The error message is:
In file included from C:/Qt/6.5.0/mingw_64/include/QtCore/qcontainertools_impl.h:20,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qarraydataops.h:9,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qarraydatapointer.h:7,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qbytearray.h:11,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qstringview.h:8,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qchar.h:656,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qstring.h:14,
from C:/Qt/6.5.0/mingw_64/include/QtCore/qobject.h:11,
from C:/Qt/6.5.0/mingw_64/include/QtWidgets/qwidget.h:9,
from C:/Qt/6.5.0/mingw_64/include/QtWidgets/qmainwindow.h:8,
from C:/Qt/6.5.0/mingw_64/include/QtWidgets/QMainWindow:1,
from debug../../untitled2/mainwindow.h:4,
from debug\moc_mainwindow.cpp:9:
/include/iterator:37:10: fatal error: iostream.h: No such file or directory
37 | #include <iostream.h>
| ^~~~~~~~~~~~
The same message occurs for main.cpp and for mainwindow.hThe sources are entirely untouched:
main.cpp
#include "mainwindow.h"#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACEclass MainWindow : public QMainWindow
{
Q_OBJECTpublic:
MainWindow(QWidget *parent = nullptr);
~MainWindow();private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_Hmainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}MainWindow::~MainWindow()
{
delete ui;
}No clue what else to look???
@rhnulm
Your Qt code looks fine. Looks more like a MinGW issue with locating headers, about which I know nothing. Someone who uses it might.Could you try to find the
Can you copy & paste the (whole of the) actual compiler output you should find in the Complier Output pane in Creator
Not the pane you have shown for the error message, the one which shows the command-line MinGW is being invoked via. Others may need to see if that is relevant for where the compiler looks for include files.
-
After complete new installation of Qt Creator 10 and Qt 6.5 on Windows11 I started a new widget project. Not changing any proposed name or file or folder. After setup of the projects by Qt I immediately tried to compile and got an error telling me
"/include/iterator:37:10: fatal error: iostream.h: no such file or directory"
In the error message "/include/iterator:37:10:" is a link (underlined) but when I click it an error occurs:" The binary editor cannot open empty files"
However, found only one file on the entire hard drive having a line "#include <iostream.h" (etip.h in the ncursesw folder)
Did not find any file named "iterator" (there are sub-directories, though)
Who in the Qt-System is still using "iostream.h"???
I am surely not the super professional in Qt but this seems very strange to my??? -
@rhnulm I guess you are using gcc/g++ to build your project on mingw_64. iostream.h is one of the most basic headers in C++. Did you install gcc/g++?
-
@JoeCFD
My limited MinGW understanding is the user showsC:/Qt/6.5.0/mingw_64
and that is supposed to be a complete MinGW g++ which comes in Qt installation that should just "work"?