User forums > General (but related to Code::Blocks)
Has anybody gotten Qt5 to work with Code::Blocks on Windows?
onesteplower:
I've been at it all day trying to get this to work. None of the instructions out there actually mention paths that exist, so it has been a guessing game. I've used the x64 installer on Windows, and I've tried the only ...\lib, ...\include, and ...\bin directories it has in all combinations in both the linker search directory in Code::Blocks and the PATH environmental variable, and still #include <QtBase> and #include “activeqtversion.h” lead to a compile error that says the file can't be found.
I've made a topic on the Qt forums, but I'm trying here too because I honestly don't even know if I'll get a response there. Since there are absolutely no installation instructions whatsoever that are not outdated and invalid, I'm at a complete standstill. The only two topics I could find on this forum are also not answered. Is it even possible to use Qt without being hamstrung into using their IDE?
stahta01:
Read the CB FAQs; it will NOT tell you how to use Qt in CB; but, should help you get rid some of the current errors you are complaining about.
http://wiki.codeblocks.org/index.php?title=Main_Page
Tim S.
onesteplower:
(Big Edit) I'm tidying this up since the info herein is growing and it's too wordy. There are many problems with installation directions out there.
Step 1: Get the SDKs and compilers.
C::B Wiki Problem 1: The "Platform SDK" mentioned in the Wiki is ambiguous. Which platform SDK? Windows? DirectX?
C::B Wiki Problem 2: The link to the "Platform SDK" is broken.
Here's the correct link: https://www.microsoft.com/en-us/download/confirmation.aspx?id=6510
Do a custom installation so you can automate setting environmental variables.
C::B Wiki Problem 3: You will need an additional SDK to that described in the C::B Wiki, but you can get your VS compiler set up in this step too.
You will need the DirectX SDK later. Lookie here: https://www.microsoft.com/en-us/download/details.aspx?id=6812
NOTE: Install the DirectX SDK BEFORE going through the VS 2010 installation steps.
...and then use this page -- http://qt-project.org/doc/qt-5.0/qtdoc/requirements-win.html
Unless you plan on developing apps for Metro in Windows 8, get the version 7.1 SDK. Follow the installation order instructions or you'll be doing it over again later!
Step 2: Install Active Perl -- http://www.activestate.com/activeperl
The newest installers include an option to set environmental variables for you.
Step 3: Install MiniGW -- http://sourceforge.net/projects/mingw/files/latest/download
Get the developer toolkit package, and the latest GCC. AFTER those install, install the MiniGW base. There will be conflicts because your Code::Blocks installation includes a DLL version, but this will ensure that you have the bin directory we'll be adding to the environmental variable in a moment.
Follow the instructions here: http://wiki.codeblocks.org/index.php?title=MinGW_installation except for the environmental variable part (we'll do that below).
After changing the line in fstab as mentioned in those instructions, make sure that the line below it is the path to your Perl library. For me, this is D:\Perl64\lib, as in the newest x64 Active Perl for Windows, there is no "ActiveState" directory.
Step 4: Catch up your environmental variables.
a. Right click "My Computer," and click "Properties."
b. In the "Advanced" tab, click the button "Environmental Variables".
c. Click the "Path" key and click "Edit".
d. Add ;(installation drive)\msys\1.0\bin to the end for msys.
e. Add ;(installation drive)\MiniGW\bin
e. Click "OK".
Note: Replace (installation drive) with the drive you installed to; e.g. "C:\", "D:\"
Note: Mind the semicolon before each entry.
Step 5: Developer Tools
a. http://www.python.org/download/
The installer has an option to update PATH for you.
b. http://rubyinstaller.org/downloads/
The installer automatically updates the PATH environmental variable.
c. Get jom and set C::B to use it.
http://qt-project.org/wiki/jom
i. Open the zip and copy the contents to clipboard.
ii. Open C::B and go to settings --> compiler
iii. Select Microsoft Visual Studio C++ 2010. If it's not there, reinstall Code::Blocks and the installer will set everything up for you.
iv. Go to Toolchain Executables --> Program Files --> Make Program
v. Click the "..." button, and paste the contents of the jom zip into the directory that opens.
vi. Select jom.exe and click open and then ok.
Step 6: Libraries
a. Get ICU -- http://site.icu-project.org/download/51
i. Extract the contents of the zip of the location of your choice.
ii. Add to the PATH environmental variable ;(extraction drive)\icu\bin64
iii. Add to the LIB environmental variable ;(extraction drive)\icu\lib64
iv. Add to the INCLUDE environmental variable ;(extraction drive)\icu\include
Let me take a moment to blabber at this point that the Qt installer directions are totally FUBAR because it doesn't update the environmental variables for the benefit of this library and the directions make no mention of it. Don't trust their installer to do its job. True story. (Looks like I found my problem's source, but I started this and I will finish it).
b. ANGLE -- https://code.google.com/p/angleproject/wiki/DevSetup
Follow the instructions there, using Visual Studio 2010 as described on that page. I just spent a little time trying to find a quick way to be sure the process could be done from within Code::Blocks, but it appears to require the Visual Studio 2010 Express debugger, and Code::Blocks does not appear to support it at this time. Plus there are some IDE interface differences that I don't want to guess about.
c. Extra Tools
Bison and Flex are already in your msys bin folder, so you will need GPerf -- http://sourceforge.net/projects/gnuwin32/files/gperf/3.0.1/gperf-3.0.1.exe/download?use_mirror=hivelocity&download=
(more edits incoming with more instructions -- I need a quick break)
Final Step: Swim three laps across the English Channel at midnight, and report back at 0-dark-thirty wearing the skin of a seduced gryphon, and you should be done!
stahta01:
Build command used with files installed by qt-windows-opensource-5.1.1-mingw48_opengl-x86-offline.exe into folder C:\Apps\Qt
--- Code: ---i686-w64-mingw32-g++.exe -Wall -g -IC:\Apps\Qt\Qt5.1.1\5.1.1\mingw48_32\include -IC:\Apps\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtGui -IC:\Apps\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtWidgets -c V:\SourceCode\CBProjects\TestProjects\testqt5\main.cpp -o obj\Debug\main.o
i686-w64-mingw32-g++.exe -LC:\Apps\Qt\Qt5.1.1\5.1.1\mingw48_32\lib -o bin\Debug\testqt5.exe obj\Debug\main.o -lQt5Core -lQt5Gui -lQt5Widgets
--- End code ---
Tim S.
onesteplower:
It still can't find the headers, after everything is updated in your commands for my system. Nada, as if they don't exist. This is with all three environmental variables set: PATH to \bin, LIB to \lib, and INCLUDE to \include. I've also tried the library finder plugin, and it says "waiting" indefinitely and then freezes when I click stop. The task manager has to be used to end Code::Blocks at that point.
C::B seems to simply refuse to acknowledge that Qt exists, and I really can't find anything that's not configured.
edit: VisualC++ can't find the headers either, and everything is configured. I've gone over it over and over and have almost written a complete step by step above to show it. I'm starting to think that the newest version of Qt is designed to prevent its use in anything but their IDE.
final edit to this post: I'm going to try and reinstall Qt. I don't know what could be wrong when all of the physical files are present, environmental variables are set, and Qt Creator runs and compiles fine. Maybe there's a registry entry that wasn't properly set or something. Whatever the case, I've been looking at a LOT of posts about Qt today and it seems that some people love it and some absolutely despise it, with very little middle ground. I can see why...
Navigation
[0] Message Index
[#] Next page
Go to full version