 Hey everybody, welcome to the 61st Qt tutorial with C++ and GUI programming. Today we're going to break from the norm and cover a different topic, one that's been kind of pestering me for a while. Okay, if you open Qt Creator and you look through your tool set, you notice you have a lot of tools here. A lot of little widgets you can use. But if you open up Qt Designer, and if you don't know what Qt Designer is, it is part of Qt. Before Qt Creator, there was actually all these independent little tools, and Qt Designer is what you design the forms with. So go into, what is it, Start, Programs, Qt, and then under Tools is Qt Designer. And when you launch this, it says, you know, what do you want to do? You want to build a dialog with buttons, etc., etc. So just say Create. But you notice how there are a lot more widgets in here. Things like, you know, gradient editor, analog clock, world clock, phone on video player, things that we haven't covered yet. And if you've been struggling along, and I'm actually going through a chapter on how to create widgets, and you're on Windows, you're going to be sadly disappointed. Here's why. Yes, you can create widgets, but I ran into this problem. When you create a widget, even from the, you know, the tutorials that they give you, you will get expected build key. Windows MSVC ReleaseFullConfig got Windows MingW ReleaseFullConfig. What does all that mean? Basically, your plugins won't load. And we can kind of verify that by going in here. Go see here about plugins. And this will show you the plugins and who created them and whether or not they're loaded. And you'll see an error message in there basically saying, you know, couldn't load your plugin. And you can go form editor about cute designer plugins is actually the correct place where you'll see the error message. And if you tried building your own custom plugin, you'll actually see your plugin here and you'll see a reason why it wasn't loaded. And that's what I ran into. And basically what I was, what I found out what I was told a very roundabout way is you have to build cute creator yourself using the MingW compiler. Let me try to explain this a little better. Cute creator was compiled with Microsoft Visual Studio. But cute creator compiles things with this MingW. And they have this special key in here that disables the ability to use widgets if you've compiled your widget with MingW. So if you've downloaded cute creator from Nokia, let's actually go there downloads. If you've downloaded this, as you know, I've been telling you to do, you won't be able to create your widgets unless you compile it or if you're running on Linux. And I think Mac has the ability to do it too. So just go ahead and download the cute creator source package, 21 megs. And once you get that downloaded, just extract it into a directory. I'm going to show you mine. And we'll say CD. What did I name that? Cute creator. And just do a dir here. And you can see I've got two directories here. I've got build and source. And there is a readme file in the source. And if you read this, it says they do not recommend building this in the source directory. They recommend two directories, a build directory and a source directory. And it kind of walks you through steps. But that's what we're going to do in this tutorial. I just really want to demystify some of this. So you've got two directories, build and source. You'll have to create the build directory yourself, by the way. The source directory contains all the source code. And let's actually go with CD. So here's my build directory. And if you do a dir, you see there is absolutely nothing in there. Now notice this is the cute command prompt, not a normal command prompt. You have to go into start program, don't get cute, and then open the cute command prompt. And that will load all the cute paths in the background. So once you've gotten to this point, you've downloaded the source, you've extracted it. You've made a build directory and a source directory. The source directory contains the source code. You've opened the cute command prompt and you've navigated to this build directory where you want to actually build this. What you need to do is run qmake. So we'll say qmake. And you need to give it the path to the project file. And we'll say c, cute creator, source. Notice how we're giving it into the source directory. And we'll say cutecreator.pro. And this is the project file. Yes, cute creator was built with cute. So it's very nice. You can actually do this. And when you hit enter, you notice qmake went really fast. But it made this make file. And what this make file has is instructions on how to build cute creator. And what it does is it kind of scans that project file and says, okay, include everything. Now because we want to compile this using the ming compiler, we'll say ming, w32. And we have to give it the command to make. And what this will do is it calls ming w32 make and it actually builds the source code. And depending on the speed of your computer, this may take a while. It may take 20 minutes, two hours, 10 days, depending on the speed of your computer. Mine's fairly fast, but I am going to pause the video because this will just go and go and go. And I'll see you when we get back. This is Brian again. And we're still compiling. Well, looks like it's time for some important things. I'll be back in a bit. Okay, well, I'm back. And let's check on this. Hey, we're done. All right, so let's actually go in here and you can see that we have our source directory and our build directory now has stuff in it. And if you go out here, you can see how it's gone out and built all these things. Now, if you're eager and you double click Qt Creator, you're going to be greeted with this. Program can't start because it can't find DLL. And then you'll find that DLL and copy it and it'll give you an error in another and another and another and another. Well, there's two methods of fixing this. The first is that you find these DLLs one at a time and copy them where they need to go, which is very tedious and boring, and I don't recommend that. Or you can go to your Qt Installation directory, make a backup of it, and then copy and overwrite all the files you just compiled into your Qt directory, which will overwrite Qt Creator. So, this is Brian and that's all for this tutorial. Let me know if you have any issues compiling. I did notice a few things when I was doing it, and let's see if I can bring up my page. I was getting undefined references. Basically, if you get undefined references, what that means is that the compiler cannot find the libraries that it needs to compile. If you get that, you've got something wrong with your environmental pass and you'll have to go in there and fix that, or you're trying to run off a straight command line instead of the Qt command line. So, that's it. Go ahead and track up piling it and see what happens.