Solved Qt modules don't seem to work
-
So I was going to write some code in c++ and I wanted to connect to my databases and write some queery. Qt += sql doesn't work for me and I don't have access to QtSql lib, I have the same problem with every other module that you can find in docs, for example I was going to work with some network connections with my program but I couldn't use QtNetwork (always the same problem "file not found" ). Maybe there's something I do wrong so I'll show steps I make:
- I add Qt += (here module)
- I rebuild .pro file
They write in documentacion, it's enough... but not in my situation. If you don't have any clues I will reinstall Qt and see if it changed anything. Also what I've noticed is I don't have location src\plugins, maybe this is the main problem. Any answer would be appreciated.
Oh this is my first post and so I don't know if the category is correct. -
Hi and welcome to devnet,
What version of Qt are you using ?
How did you install it ?
What OS are you running ? -
@SGaist Hello, thanks for response!
- So according to info from Qt IDE it's "Qt Creator 4.8.2 '\n' Based on Qt 5.12.1 (MSVC 2015, 32 bit)".
- I downloaded installation .exe from official website
- Windows 10 Home 64bit
I use mingw64 g++ as compiler.
-
That's the version of Qt Creator and the Qt version used to build it. Now what version are you using to build your application ?
Can you also share your .pro file ? -
@SGaist So I think it's Qt Creator 4.8.2 (if it's not what you are looking for tell me where to find it, sorry I'm still learning). Here's my .pro file
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
QT += network
QT += sql
SOURCES += \
main.cpp -
Ok I think I know where is the problem, there's CONFIG -= qt, when I deleted it, I was able to compile "hello world" program with QtNetwork and QtSql. I'm waiting for verification if this is the clue. However there is still a case if i can compile it, why in my Qt directory I don't have 'src\plugins'.
-
@PiotrWojtowicz said in Qt modules don't seem to work:
Ok I think I know where is the problem, there's CONFIG -= qt
Yes, that's a problem.
CONFIG -= qt
means "Remove Qt from this project" or "Don't use Qt in this project".why in my Qt directory I don't have 'src\plugins'
This is only available when you download the Qt source code. You only need it if you want to build the plugin from source.
You don't need it if you use a pre-built plugin.
-
@PiotrWojtowicz said in Qt modules don't seem to work:
So I think it's Qt Creator 4.8.2
Again: this is QtCreator version NOT Qt.
QtCreator != Qt -
@jsulm Thank you for advice, could you tell me where should I look for Qt version then?
-
@PiotrWojtowicz said in Qt modules don't seem to work:
where should I look for Qt version then?
In QtCreator in your Kit configuration (Tools/Options.../Build & Run).
-
@jsulm So my version is 5.12.1