im new at qt creator and qt quick. I've been trying to create a project using qt quick and qmake with webassembly kit. When i try to run my newly created project i get this error:
I've searched the error but none of solutions work for me so i decided to look qt creator examples. I've created example project with exactly same kit and it works. Then i check the build folders of both projects;
this is my project;
And this is example project;
These 3 files are not created when i create a new project using exactly the same kits.
edit: my best guess, an error because of mingw32-make.exe somehow.
so in qt creator projects/general/run:
this is my project;
and this is the example project;
edit 2: I've tried to run mingw32-make.exe on cmd
em++ -c -O2 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\deneme4 -I. -IC:\Qt\5.15.2\wasm_32\include -IC:\Qt\5.15.2\wasm_32\include\QtQuick -IC:\Qt\5.15.2\wasm_32\include\QtGui -IC:\Qt\5.15.2\wasm_32\include\QtQmlModels -IC:\Qt\5.15.2\wasm_32\include\QtQml -IC:\Qt\5.15.2\wasm_32\include\QtNetwork -IC:\Qt\5.15.2\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.2\wasm_32\mkspecs\wasm-emscripten -o main.obj ..\deneme4\main.cpp
em++ -c -O2 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\deneme4 -I. -IC:\Qt\5.15.2\wasm_32\include -IC:\Qt\5.15.2\wasm_32\include\QtQuick -IC:\Qt\5.15.2\wasm_32\include\QtGui -IC:\Qt\5.15.2\wasm_32\include\QtQmlModels -IC:\Qt\5.15.2\wasm_32\include\QtQml -IC:\Qt\5.15.2\wasm_32\include\QtNetwork -IC:\Qt\5.15.2\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.2\wasm_32\mkspecs\wasm-emscripten -o deneme4.js_plugin_import.obj D:/Programlama/qt_projects/build-deneme4-Qt_5_15_2_WebAssembly-Debug/deneme4.js_plugin_import.cpp
em++ -c -O2 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\deneme4 -I. -IC:\Qt\5.15.2\wasm_32\include -IC:\Qt\5.15.2\wasm_32\include\QtQuick -IC:\Qt\5.15.2\wasm_32\include\QtGui -IC:\Qt\5.15.2\wasm_32\include\QtQmlModels -IC:\Qt\5.15.2\wasm_32\include\QtQml -IC:\Qt\5.15.2\wasm_32\include\QtNetwork -IC:\Qt\5.15.2\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.2\wasm_32\mkspecs\wasm-emscripten -o deneme4.js_qml_plugin_import.obj D:/Programlama/qt_projects/build-deneme4-Qt_5_15_2_WebAssembly-Debug/deneme4.js_qml_plugin_import.cpp
C:\Qt\5.15.2\wasm_32\bin\rcc.exe -name qml ..\deneme4\qml.qrc -o qrc_qml.cpp
em++ -c -O2 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\deneme4 -I. -IC:\Qt\5.15.2\wasm_32\include -IC:\Qt\5.15.2\wasm_32\include\QtQuick -IC:\Qt\5.15.2\wasm_32\include\QtGui -IC:\Qt\5.15.2\wasm_32\include\QtQmlModels -IC:\Qt\5.15.2\wasm_32\include\QtQml -IC:\Qt\5.15.2\wasm_32\include\QtNetwork -IC:\Qt\5.15.2\wasm_32\include\QtCore -I. -I/.emscripten_ports/openssl/include -IC:\Qt\5.15.2\wasm_32\mkspecs\wasm-emscripten -o qrc_qml.obj qrc_qml.cpp
C:\Qt\5.15.2\wasm_32\bin\qmake.exe -install sed -e s/#APPNAME#/deneme4/g C:/Qt/5.15.2/wasm_32/plugins/platforms/wasm_shell.html > D:/Programlama/qt_projects/build-deneme4-Qt_5_15_2_WebAssembly-Debug/deneme4.html
copy /y C:\Qt\5.15.2\wasm_32\plugins\platforms\qtloader.js D:\Programlama\qt_projects\build-deneme4-Qt_5_15_2_WebAssembly-Debug
1 file(s) copied.
copy /y C:\Qt\5.15.2\wasm_32\plugins\platforms\qtlogo.svg D:\Programlama\qt_projects\build-deneme4-Qt_5_15_2_WebAssembly-Debug
1 file(s) copied.
em++ -s WASM=1 -s FULL_ES2=1 -s FULL_ES3=1 -s USE_WEBGL2=1 -s EXIT_RUNTIME=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] --bind -s FETCH=1 -O2 -s ALLOW_MEMORY_GROWTH=1 -o .\deneme4.js main.obj deneme4.js_plugin_import.obj deneme4.js_qml_plugin_import.obj qrc_qml.obj C:/Qt/5.15.2/wasm_32/plugins/platforms/libqwasm.a C:/Qt/5.15.2/wasm_32/lib/libQt5EventDispatcherSupport.a C:/Qt/5.15.2/wasm_32/lib/libQt5FontDatabaseSupport.a C:/Qt/5.15.2/wasm_32/lib/libqtfreetype.a C:/Qt/5.15.2/wasm_32/lib/libQt5EglSupport.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqgif.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqicns.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqico.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqjpeg.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqtga.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqtiff.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqwbmp.a C:/Qt/5.15.2/wasm_32/plugins/imageformats/libqwebp.a C:/Qt/5.15.2/wasm_32/qml/QtQuick.2/libqtquick2plugin.a C:/Qt/5.15.2/wasm_32/qml/QtQuick/Window.2/libwindowplugin.a C:/Qt/5.15.2/wasm_32/lib/libQt5Quick.a C:/Qt/5.15.2/wasm_32/lib/libQt5Gui.a C:/Qt/5.15.2/wasm_32/lib/libqtlibpng.a C:/Qt/5.15.2/wasm_32/lib/libqtharfbuzz.a C:/Qt/5.15.2/wasm_32/qml/QtQml/libqmlplugin.a C:/Qt/5.15.2/wasm_32/qml/QtQml/Models.2/libmodelsplugin.a C:/Qt/5.15.2/wasm_32/lib/libQt5QmlModels.a C:/Qt/5.15.2/wasm_32/lib/libQt5Qml.a C:/Qt/5.15.2/wasm_32/lib/libQt5Network.a C:/Qt/5.15.2/wasm_32/lib/libQt5Core.a C:/Qt/5.15.2/wasm_32/lib/libqtpcre2.a
cache:INFO: generating system library: libc.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libc.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libcompiler_rt.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libcompiler_rt.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libc-wasm.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libc-wasm.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libc++-noexcept.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libc++-noexcept.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libc++abi-noexcept.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libc++abi-noexcept.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libembind-rtti.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libembind-rtti.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libfetch.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libfetch.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libgl-webgl2-full_es3.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libgl-webgl2-full_es3.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libdlmalloc.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libdlmalloc.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libpthread_stub.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libpthread_stub.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libc_rt_wasm.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libc_rt_wasm.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system library: libsockets.a... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\libsockets.a" for subsequent builds)
cache:INFO: - ok
cache:INFO: generating system asset: generated_struct_info.json... (this will be cached in "C:\programming-tools\emscripten\emsdk\upstream\emscripten\cache\wasm-obj\generated_struct_info.json" for subsequent builds)
cache:INFO: - ok
it works but why it doesn't work on qt creator?
Related
I have tried this on multiple platforms, experiencing the same issue every time.
I successfully build and run my C++ OpenFrameworks application using QtCreator - no problems are encountered.
Then, I successfully use qmake to generate the project file.
Yet when I attempt to make the executable, I receive the following error:
make
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++1z -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=12 -Wall -Wextra -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/opt/homebrew/lib/QtGui.framework/Headers -I/opt/homebrew/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/AGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/AGL.framework/Headers -I/opt/homebrew/share/qt/mkspecs/macx-clang -F/opt/homebrew/lib -o main.o src/main.cpp
src/main.cpp:1:10: fatal error: 'ofMain.h' file not found
#include "ofMain.h"
^~~~~~~~~~
1 error generated.
make: *** [main.o] Error 1
I can go into the .pro file and add things to the include path manually, but I don't see why these includes aren't generated automatically?
I think I recognized your problem.
The file name is main.cpp in the src/ folder. Based on its location in the src/ folder, I think your ofMain.h file is also in the src/ folder. Now a question: did you add src/ to your include path? If not with the following line:
INCLUDEPATH += \
src/
It should work now I hope.
Have a nice day!
I have a directory with Qt 5.15 for gcc_64 on Ubuntu. I know I need to link the proper .so (or .la?) file in the lib subdirectory and include the headers from the include directories. I would need to do this for several Qt modules. This is my second day using Linux and Bazel, and I'm not sure how to get a basic build setup going. I have tried using cc_import and cc_library so far without sucess.
I know everything is done automatically for you when using Qt Creator, but I am using Visual Sudio Code with a the Bazel build system for integration of other projects.
Here is a piece of the compiler input for a sample project when using Qt Creator.
g++ -c -pipe -g -Wall -Wextra -D_REENTRANT -fPIC -DQT_QML_DEBUG
-DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../addressbook -I. -I/home/joseph/Qt/5.15.0/gcc_64/include -I/home/joseph/Qt/5.15.0/gcc_64/include/QtWidgets -I/home/joseph/Qt/5.15.0/gcc_64/include/QtGui -I/home/joseph/Qt/5.15.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/home/joseph/Qt/5.15.0/gcc_64/mkspecs/linux-g++
-o addresswidget.o ../addressbook/addresswidget.cpp
I see macros, includes, and libraries added. What is all the other stuff?
An alternate route I have decided is to build a library out of a qt project and use that with Bazel. With this, how would I access GUI objects? Would I have signal and slots?
I've downloaded the QtSDK for windows and installed it.
I'm using QtCreator to run their test program but run into this problem:
17:03:30: Running build steps for project keepintouch...
17:03:30: Configuration unchanged, skipping qmake step.
17:03:30: Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe"
C:/QtSDK/mingw/bin/mingw32-make.exe -f Makefile.Debug
mingw32-make.exe[1]: Entering directory `C:/QtSDK/Examples/QtMobility/keepintouch- build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug2'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL - DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN - I"..\..\..\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"..\..\..\Desktop\Qt\4.8.1\mingw\include\QtGui" -I"..\..\..\Desktop\Qt\4.8.1\mingw\include" -I"..\..\src\messaging" -I"..\..\src\contacts" -I"..\..\src\contacts\details" -I"..\..\src\contacts\filters" -I"..\..\src\contacts\requests" -I"..\..\..\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"..\keepintouch" -I"." -I"..\..\..\Desktop\Qt\4.8.1\mingw\mkspecs\win32-g++" -o debug\addressfinder.o ..\keepintouch\addressfinder.cpp
mingw32-make.exe[1]: Leaving directory `C:/QtSDK/Examples/QtMobility/keepintouch-build- desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug2'
mingw32-make.exe[1]: *** [debug/addressfinder.o] Error 1
mingw32-make.exe: *** [debug] Error 2
17:03:31: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project keepintouch (target: Desktop)
When executing build step 'Make'
I tried the instructions of building latest QT5-Alpha(http://qt-project.org/wiki/Qt-5-Alpha
http://qt-project.org/wiki/Building_Qt_5_from_Git)
from GIT,but facing compilation in wayland files
Ubuntu Linux 11.10
__make[4]: Entering directory `/home/xyz/build/newqt5/qt5/qtwayland/src/plugins/platforms/wayland'
g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_LIBUDEV -DQ_PLATFORM_WAYLAND -DQT_NO_WAYLAND_XKB -DQT_WAYLAND_GL_SUPPORT -DQT_WAYLAND_WINDOWMANAGER_SUPPORT -DQ_FONTCONFIGDATABASE -DQT_COMPILES_IN_HARFBUZZ -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I/home/xyz/build/newqt5/qt5/qtbase/mkspecs/linux-g++ -I. -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include -I../../../shared -Igl_integration/xcomposite_share -I.moc/debug-shared -o .obj/debug-shared/qwaylandintegration.o qwaylandintegration.cpp
In file included from qwaylandshmwindow.h:45:0,
from qwaylandintegration.cpp:46:
qwaylandwindow.h:112:18: error: ‘wl_callback_listener’ does not name a type
make[4]: *** [.obj/debug-shared/qwaylandintegration.o] Error 1_
Any pointers to overcome this?
Download the alpha source package here: http://releases.qt-project.org/qt5.0/alpha/ and use the steps in README file.
The master in git is NOT what was released as alpha. The build scripts are different. You have to wait for them to add alpha tag to pull it from git. But why not just grab the gz file?
I built a Qt project in Debug mode with Qt Creator, ran Callgrind to generate profiling data and tried loading it into Cachegrind. I noticed that I only see profiling information for Qt classes, so I figured I must have forgotten to turn on a crucial flag.
Qt Creator's qmake command looks like this:
qmake /path/to/project/MyProject/MyProject.pro -r -spec linux-g++-64 CONFIG+=debug
Sample compile output for one file:
g++ -c -m64 -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I../Flowchart -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -I../Flowchart -I. -o main.o ../Flowchart/main.cpp
The -g flag is there, so debug information should be available. I verified this by running gdb on the executable and trying to look at some random source code with l.
The Callgrind command I used was:
valgrind --tool=callgrind ./MyProject
What am I missing here?
You should do:
valgrind --tool=callgrind --trace-children=yes --demangle=yes ./MyProject
Also depending on the distribution of Linux you may have to make sure that you have the Debug information in the QT libraries you are linking against.