#1 Members - Reputation: 181
Posted 23 August 2012 - 02:24 PM
~Saint Squireen
#2 Members - Reputation: 1868
Posted 23 August 2012 - 02:37 PM
If you're talking about taking your executable, DLLs and assets and dealing with them as a unit, I've heard it called "packaging" and "deployment".
On Windows, you need to compile your code such that it generates an EXE file. After that, the EXE file can be put almost anywhere (including your desktop, but people normally put shortcuts on the windows desktop, not the EXE itself). Any dependencies that the EXE has (such as DLLs or game assets like bitmaps, 3d models, sounds, etc) must be located with it or installed to a search path. Most programs will come in an installer which unpacks everything to C:\Program Files (x86)\YourAppName and sets up any registry keys you might need, but you can often just Zip up all the files and give them to someone else and have them unzip them in their Downloads folder if they want.
On OSX, all I can remember is that there's a folder you have to set up that contains the executable, some configuration metadata files, your assets, etc. Then that folder is more-or-less treated as a unit when you want to share or install it.
#3 Members - Reputation: 181
Posted 23 August 2012 - 02:55 PM
~Saint Squireen
#5 Crossbones+ - Reputation: 3558
Posted 23 August 2012 - 03:52 PM
Note sometimes the console window immediately closes once your program ends (this doesn't happen while developing because your IDE prevents it from doing that), to prevent this put a system("PAUSE") or a readln() before the final return which will hang the program until you hit a key to exit.
About sharing, make sure you only hand out release builds, because otherwise your program might need extra developer libraries that the person you're sharing the program with probably doesn't have.
#7 Marketplace Seller - Reputation: 8956
Posted 23 August 2012 - 09:27 PM
C++ is the programming language you maybe are using.
Qt is a set of libraries (also called an API) for C++ that are also available in other languages.
QtCreator is a C++ code editor (also called an IDE) similar to how Microsoft Word is an "english language editor", that is made for using Qt with C++ in an easier manner.
To answer this, does the program you type code in look like this:

If so, in the bottom-left corner, you have three large buttons: A green arrow, a green arrow with a blue bug, and a hammer:

Compiling is the process of taking the text and turning it into something the computer can run.
Whenever you click any of those three buttons, if your program compiles without errors, you'll generate what's called an "executable". Wherever you told QtCreator to save your project, your executable should be somewhere near there.
Executables using Qt can't run on their own - they need some DLLs (the Qt libraries) to be put in the same folder with the executable to be able to run properly.
The default location your project might have been saved in (if using Windows), is in C:/Users/<username>/ but it depends. Do a search for your project name in Windows Explorer, and it'll probably turn up.
Once you find your project folder, look for a folder called something like "desktop-debug" or "debug" or "release" or something like that. Just look inside every subfolder. What you are looking for is your executable. The file extension is '.exe', but if you can't see any file extensions (Windows has them turned off by default), if you see something that looks like the file highlighted in red:

And if it says "Application" or "Executable" or "Binary" in Windows Explorer's info pane (highlighted in blue), and if it's in a subfolder of your project, it is probably maybe your game. Right click on the excutable, select "Send To -> Desktop (create shortcut)".

You need the two DLLs highlighted in green (the 2nd to last screenshot) as well. Those are probably located at "C:\Qt\<your Qt API version>\lib\", and the ones you want are called:
QtGui4.dll
QtGuid4.dll
QtCore4.dll
QtCored4.dll
The .dll part of the name might not be visible. It's also possible that the '4' would be replaced with a '5'.
The reason why there are two versions of each DLL (one with a 'd' before the 4, and one without) is because the ones with the 'd' are for if your executable was built using debugging enabled... which it probably is. Just incase, to simplify things, copy all four of them into the folder where your executable is. (Note: You are COPYING don't cut or move. Copy). The DLLs must be copied in the exact same folder as your executable (not your executable's shortcut, but the original executable itself).
Maybe your program will run when you double-click the executable. If a error message pops up, tell us exactly what it says.
It's all kinda confusing if this is your first introduction to all this stuff (but fairly simple once you get the hang of it). If you're having trouble with it, post here with what part you don't understand.
Edited by Servant of the Lord, 23 August 2012 - 09:30 PM.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal
#9 Members - Reputation: 181
Posted 28 August 2012 - 05:16 PM
~Saint Squireen
#10 Marketplace Seller - Reputation: 8956
Posted 28 August 2012 - 05:33 PM
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal
#11 Members - Reputation: 181
Posted 28 August 2012 - 05:50 PM
~Saint Squireen
#12 Marketplace Seller - Reputation: 8956
Posted 28 August 2012 - 06:15 PM
[Edit:] I'll try harder to explain their location tomorrow when I have time.
Edited by Servant of the Lord, 28 August 2012 - 07:08 PM.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal
#13 Members - Reputation: 1406
Posted 29 August 2012 - 02:56 AM
Edit: Actually it might not be. If he actively links to Qt it is probably precompiled using the dynamic runtime. While it would be possible to recompile them with the static runtime that's not something you should ask a beginner to try.
#14 Marketplace Seller - Reputation: 8956
Posted 29 August 2012 - 10:06 AM
Now, there are multiple different locations where you can find the Qt DLLs, depending on what versions you have installed and where you installed them, and with what package you installed them (bundled with QtCreator or not). I have at least three different installs of Qt on my system (don't ask why
For me, I can find mine here: C:\Qt\<qt version>\bin
And here (different install): C:\QtSDK\Desktop\Qt\<qt version>\mingw\bin <-- This is probably your install (my mistake with the earlier suggested path).
If you know how to do a search on Windows, you can also search for "QtCore4.dll" and the other DLLs. I don't recommend this though, because there are multiple copies of QtCore4.dll on your computer, and not all of them are the right one (they aren't all binary compatible with your executable).
This might seem really confusing, but once you get used to it, you'll handle this kind of thing with ease. The problem is I don't know what your knowledge level is, so I'm having to half teach you how to use windows while half-explaining how to use DLLs, while fully explaining where to find the Qt-specific DLLs. Part of any confusion is trying to learn multiple things at once, and part of it is from the people explaining it (me) doing a poor job by being half-blind not knowing your skill level and not visually seeing your computer.
I'm going to walk you through the second possible path I mentioned above. When you are following the paths, and you can't find it exactly, but there is something similar, try that (the DLL names don't change, but the folder names might change slightly).
Possible path:
Once you find the DLLs mentioned, which are the Qt API dlls, you need two more DLLs (the GCC C++ standard language DLLs among other stuff). These are in a different location. Once you find the Qt ones, then I'll explain where the GCC ones are, which are easier to find.
If the Qt DLLs still can't be found, just let me know, and instead what we'll is we'll figure out what version of Qt you are running, and I'll just upload the DLLs somewhere for you to download.
Edited by Servant of the Lord, 29 August 2012 - 10:49 AM.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal
#15 Members - Reputation: 444
Posted 29 August 2012 - 10:19 AM
- Open up your project in QtCreator
- go to "Projects" (toolbutton in the left pane)
- select "Build Settings" (should be selected by default).
- Now in the "General" category the first entry is "Qt version". Click on "manage" right next to it.
- It should show you the path to the Qt version used by the QtCreator. The "qmake" Location shows you the path of the qmake.exe file which is located in the same folder as the Qt DLLs. Now use the windows explorer to navigate to it and copy the DLLs following SoL's description.
#17 Marketplace Seller - Reputation: 8956
Posted 29 August 2012 - 09:14 PM
Now we need to go to C:\QtSDK\mingw\bin
The DLLs you want are:
- libgcc_s_dw2-1.dll
- libstdc++-6.dll
- mingwm10.dll
You should have:
Your stuff:
- your-game.exe (whatever you name it is fine, as long as it ends in .exe (if you have extensions visible))
- Your game's data files (images, sounds, etc... These don't have to be in the same folder as your game, but your game needs to know where to find them)
- libgcc_s_dw2-1.dll (the names matter, keep them as-is)
- libstdc++-6.dll
- mingwm10.dll
- QtGui4.dll
- QtCore4.dll
- QtGuid4.dll
- QtCored4.dll
If no message pops up, your game probably has all the right stuff, however it's possible it still might crash or close silently during startup if it can't find your own resource files, depending on how you do your own game's error handling.
Edited by Servant of the Lord, 29 August 2012 - 09:15 PM.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal
#20 Marketplace Seller - Reputation: 8956
Posted 31 August 2012 - 02:48 PM
It depends on what your applications use.
For C++ compiled by MinGW, you'll need the MinGW libraries. (MinGW is your compiler)
For Qt, you'll also need the Qt libraries. (Qt is the API you are using. QtCreator is the IDE you are using (the program you write your code in))
For other APIs, you'll need those APIs' libraries.
Some libraries statically link (meaning the library code is mixed into your executable itself), and some dynamically link (meaning the library code is in the DLLs - Dynamically Linked Library). Anything you dynamically link to, the DLL you are linking against must be able to be found by the executable. This means they must be either: A) In the same directory as the .exe or B) somewhere in the user's PATH environment (a special set of file paths handled by the operating system - paths can be added or removed by installers or by users themselves, and the OS already has some paths built-in).
So: Whatever libraries you use, you need to make sure the library code can be found by your program.
Qt is actually a collection of libraries (I think 5? Plus additional add-on libraries - this is why there are 20 uniquely named dlls in the folder where you found QtCore4.dll), and whichever parts of the library you link against in your program, those are the parts you need. You are only linking against two parts of the library: The Qt Core (QtCore4.dll = Qt Core library, for Qt version 4.x), and the Qt GUI. There are also other parts, like Qt Networking that you aren't currently using or linking against, and so don't need to add.
As mentioned earlier, with Qt, each DLL has a version compiled for Debugging, and a version compiled for Release (meaning there are over 40 DLLs in total in that folder). This is the 'd' in QtCored4.dll. You only need one or the other, depending on which one your program linked against - Since I didn't know which one you linked against, I just had you include both versions to be 100% sure your program would work.
For comparison, my own project uses 16 DLLs: 2 from Qt, 4 from SFML, 2 other libraries required by SFML, 2 from Boost, 1 from Lua, 1 from MinGW, and 4 more small ones to play videos. I'm sure something like World of Warcraft probably has close to a hundred. I see 70 DLLs required by Dungeon Defenders for PC
Because of my confusion about what's required by MinGW, of your 7 DLLs, you actually only need about 3 of them.
I would guess you probably only need:
- libstdc++-6.dll
- QtGuid4.dll
- QtCored4.dll
You could delete the others from the folder where your executable is, and see if the executable still runs properly, and if it doesn't, add them back one by one until it does run fine. Or, you could use a tool like Dependency Walker which tells you what DLLs your program needs.
Edited by Servant of the Lord, 31 August 2012 - 02:50 PM.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal















