Trouble configuring qt - can't find function _popen
-
Hello,
I'm trying to build stellarium from source but I've run into a problem configuring qt. When I try and run the configure.bat script, I get the following errors:
C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QByteArray QMakeEvaluator::getCommandOutput(const QString&, int*) const': C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:76:18: error: '_popen' was not declared in this scope; did you mean '_lopen'? 76 | #define QT_POPEN _popen | ^~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:540:22: note: in expansion of macro 'QT_POPEN' 540 | if (FILE *proc = QT_POPEN(QString(QLatin1String("cd ") | ^~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:78:19: error: '_pclose' was not declared in this scope; did you mean '_lclose'? 78 | #define QT_PCLOSE _pclose | ^~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:550:18: note: in expansion of macro 'QT_PCLOSE' 550 | int ec = QT_PCLOSE(proc); | ^~~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(const QMakeInternal::QMakeBuiltin&, const ProKey&, const ProStringList&, ProStringList&)': C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:1241:25: error: 'KEY_WOW64_32KEY' was not declared in this scope 1241 | flags = KEY_WOW64_32KEY; | ^~~~~~~~~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:1244:25: error: 'KEY_WOW64_64KEY' was not declared in this scope 1244 | flags = KEY_WOW64_64KEY; | ^~~~~~~~~~~~~~~ Makefile:255: recipe for target 'qmakebuiltins.o' failed mingw32-make: *** [qmakebuiltins.o] Error 1
While all the errors are an issue, I'm mainly concerned about the _popen one. Both windows.h and stdio.h have been #include'd, and I even upgraded my mingw install to try and fix the error, but not luck.
Has anyone encountered anything like this in their build/ know who to fix it?
Thanks
-
Hello,
I'm trying to build stellarium from source but I've run into a problem configuring qt. When I try and run the configure.bat script, I get the following errors:
C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QByteArray QMakeEvaluator::getCommandOutput(const QString&, int*) const': C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:76:18: error: '_popen' was not declared in this scope; did you mean '_lopen'? 76 | #define QT_POPEN _popen | ^~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:540:22: note: in expansion of macro 'QT_POPEN' 540 | if (FILE *proc = QT_POPEN(QString(QLatin1String("cd ") | ^~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:78:19: error: '_pclose' was not declared in this scope; did you mean '_lclose'? 78 | #define QT_PCLOSE _pclose | ^~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:550:18: note: in expansion of macro 'QT_PCLOSE' 550 | int ec = QT_PCLOSE(proc); | ^~~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(const QMakeInternal::QMakeBuiltin&, const ProKey&, const ProStringList&, ProStringList&)': C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:1241:25: error: 'KEY_WOW64_32KEY' was not declared in this scope 1241 | flags = KEY_WOW64_32KEY; | ^~~~~~~~~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:1244:25: error: 'KEY_WOW64_64KEY' was not declared in this scope 1244 | flags = KEY_WOW64_64KEY; | ^~~~~~~~~~~~~~~ Makefile:255: recipe for target 'qmakebuiltins.o' failed mingw32-make: *** [qmakebuiltins.o] Error 1
While all the errors are an issue, I'm mainly concerned about the _popen one. Both windows.h and stdio.h have been #include'd, and I even upgraded my mingw install to try and fix the error, but not luck.
Has anyone encountered anything like this in their build/ know who to fix it?
Thanks
-
Hello,
I'm trying to build stellarium from source but I've run into a problem configuring qt. When I try and run the configure.bat script, I get the following errors:
C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QByteArray QMakeEvaluator::getCommandOutput(const QString&, int*) const': C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:76:18: error: '_popen' was not declared in this scope; did you mean '_lopen'? 76 | #define QT_POPEN _popen | ^~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:540:22: note: in expansion of macro 'QT_POPEN' 540 | if (FILE *proc = QT_POPEN(QString(QLatin1String("cd ") | ^~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:78:19: error: '_pclose' was not declared in this scope; did you mean '_lclose'? 78 | #define QT_PCLOSE _pclose | ^~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:550:18: note: in expansion of macro 'QT_PCLOSE' 550 | int ec = QT_PCLOSE(proc); | ^~~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(const QMakeInternal::QMakeBuiltin&, const ProKey&, const ProStringList&, ProStringList&)': C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:1241:25: error: 'KEY_WOW64_32KEY' was not declared in this scope 1241 | flags = KEY_WOW64_32KEY; | ^~~~~~~~~~~~~~~ C:/qt5/qtbase/qmake/library/qmakebuiltins.cpp:1244:25: error: 'KEY_WOW64_64KEY' was not declared in this scope 1244 | flags = KEY_WOW64_64KEY; | ^~~~~~~~~~~~~~~ Makefile:255: recipe for target 'qmakebuiltins.o' failed mingw32-make: *** [qmakebuiltins.o] Error 1
While all the errors are an issue, I'm mainly concerned about the _popen one. Both windows.h and stdio.h have been #include'd, and I even upgraded my mingw install to try and fix the error, but not luck.
Has anyone encountered anything like this in their build/ know who to fix it?
Thanks
@vega
I know nothing about MinGW. But_popen()
etc. are "low-level" OS calls. Supplied under Linux, seems to be there from MSVC. But not necessarily MinGW. See e.g. https://stackoverflow.com/questions/46343789/cant-find-popen-and-pclose-with-windows-codeblocks-mingw-16-01, https://stackoverflow.com/questions/22166633/mingw-function-not-found-when-compiled-with-std-c11, https://github.com/boostorg/type_erasure/issues/16 for others reporting problem on_popen
under MinGW. -
@vega Do you use the MinGW console to compile (you will find it in Qt menu in Windows start menu)?
What exact MinGW version do you use? -
I'm pretty sure you've msys in your PATH and therefore configure is picking up the wrong compiler.
-
I'm pretty sure you've msys in your PATH and therefore configure is picking up the wrong compiler.
@Christian-Ehrlicher It looks like I have both MinGW and msvs2017 (from qt) in my PATH. Should I removed MinGW?
-
It depends on what you want to sue to compile Qt - MSVC or MinGW - only one of them should be visible to configure when compiling Qt.
Why do you want to compile Qt at all? -
It depends on what you want to sue to compile Qt - MSVC or MinGW - only one of them should be visible to configure when compiling Qt.
Why do you want to compile Qt at all?@Christian-Ehrlicher I'm building Stellarium from source, and I need Qt in order to do so.
-
It depends on what you want to sue to compile Qt - MSVC or MinGW - only one of them should be visible to configure when compiling Qt.
Why do you want to compile Qt at all?@Christian-Ehrlicher Also, when I try and combile with just MinGW in path, I get the same error. When I try and compile with just msvc, I get an error that says "Cannot detect host toolchain. Please use -platform. Aborting."
-
-
It is necessary to change the mingw version according to the table https://wiki.qt.io/MinGW.