pacman -S mingw-w64-x86_64-qt-creator
and
pacman -S mingw-w64-x86_64-qt
#include <iostream>
int main() {
std::cout << "Qt version: " << qVersion() << std::endl;
}
g++ -o example1.exe example1.cpp -I/C:/msys64/mingw64/include/QtCore -I/C:/msys64/mingw64/qt5-static/include/QtCore -L/C:/msys64/mingw64/qt5-static/lib -lQt5Core -fPIC
however, compilation comes with an error message,
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccpq7uZL.o:my_qt_program2.cpp:(.text+0x2c): undefined reference to `__imp_qVersion'
collect2.exe: error: ld returned 1 exit status
may be i have not installed all Qt-packages required in Msys2-Mingw64 ?
example2.cpp
-----------------------------
#include <QApplication>
#include <QWidget>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QWidget window; window.resize(250, 150); window.setWindowTitle("Simple example"); window.show(); return app.exec();
}
qmake -project
qmake
make
after that the separate directory "release" was created (inside), where the executable "example2.exe" was created. however, when i try to execute that file in Mingw64 console, nothing is happened, that is the windows "Simple example" does not appear.
i would appreciate someone(s) in the Forum to explain me, where i made a compilation error; or it is associated with Mingw64-Msys2 ?
_______________________________________________ Msys2-users mailing list Msys2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/msys2-users