Solved QMimeTypes library is missing in Qt Creator
-
Hello,
I have a binary stl file but in the code I need to convert this file to Ascii. When I searched on the web, there is a library which is called QMimeType and another one is QMimeDatabase added to Qt. But my Qt Creator gives error when I add these to my code. Error is: no such file or director.
How can I solve this problem? Thank you in advance. -
@aysenur
how does your include statement look like? -
#include <QMimeType>
#include <QMimeDatabase>
When I write these, Qt Creator gives error no such file or directory error. -
Hi,
can you please paste your .pro file here? -
@aysenur
thats strange, since those are part of QtCore.
How does your .pro file look like? -
My pro file code:
QT += core gui openglSeems to be necessary on Linux
unix: LIBS += -lGLU
TARGET = stl-viewer
TEMPLATE = appSetup an installation target
target.path = /usr/bin
INSTALLS += targetSOURCES += main.cpp
mainwindow.cpp
stlview.cpp
form.cppHEADERS += mainwindow.h
stlview.h
form.hFORMS += mainwindow.ui
form.uiRESOURCES +=
resource.qrc -
@aysenur
but your project compiles even QtCreator says the file doesn't exist? -
Sorry I send the pro file which only has QtMimeData library.
QT += core gui opengl
Seems to be necessary on Linux
unix: LIBS += -lGLU
TARGET = stl-viewer
TEMPLATE = appSetup an installation target
target.path = /usr/bin
INSTALLS += targetSOURCES += main.cpp
mainwindow.cpp
stlview.cpp
form.cppHEADERS += mainwindow.h
stlview.h
form.hFORMS += mainwindow.ui
form.uiRESOURCES +=
resource.qrcIf you compile this code you will see the error. This code looks to the file under /usr/include/qt4 and qt4 does not have mimetype library files. I downloaded qt5.7 now and I will create a new project which will work with 5.7.
-
I have qt4 under /usr/include and also in home directory qt5.7. My Qt Creator looks the files under qt4. How can I change this? Do I need to erase qt4 files and copy qt5.7 files under /usr/include? Thank you inadvance.
-
Hi,
No you don't. Go to the Build and Run part of Qt Creator's settings. There add your Qt 5.7 to the Qt versions if not available and then create a kit using it. Finally, build your project using that kit.
-
Thank you so much. I have downloaded Qt5.9.1 and deleted the Desktop kit which looks to qt4. Opened the project again and selected Desktop kit for 5.9.1. System does not give error for QMimeType library anymore.