• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Saint Squireen

Compiling a Desktop Application?

21 posts in this topic

Does anybody know how to "Compile" a desktop application? I use "Compile" loosely because I don't know if thats the term I am looking for. Basically all I want to do is be able to have an app on my desktop that I can just click or double click and open it and run my game. P.S.- A plus if I can share the app easily, such as linking it in an email (if its small enough of corse) or file share it.
0

Share this post


Link to post
Share on other sites
I am on windows and the only programs and games that I have written so far are basic coding (only text). No sounds, colors, shapes or any of that awesome stuff. Btw, I am using QT as my coding application (because I am practicing widgets and all that). So do you know how to make an executable for that?
0

Share this post


Link to post
Share on other sites
Thanks I'll be sure to try this. I'm not capable of reaching my computer yet but I will soon. I'll post back either asking for help or saying thank you but either way, I'll post back. Thanks again:)
0

Share this post


Link to post
Share on other sites
For some reason i dont have any dll's or anything like that. Also i get this image?text box saying "The program can't start because mingwm10.dll is missing from your computer. Try reinstalling the program to fix this problem." What do i do now?
0

Share this post


Link to post
Share on other sites
Do you write your code into a program that looks like this?

[img]http://img585.imageshack.us/img585/7025/qtcreator.png[/img]
1

Share this post


Link to post
Share on other sites
Yes. Follow me through this. I open up QT, go to create a new project, under Choose a Template:, go down to Other Project, then slide the scrollbar in the box next to that down to Plain C++ Project. Thats what I made my project in.
0

Share this post


Link to post
Share on other sites
Alright, well, the DLLs [i]are[/i] there on your computer somewhere (Probably [i]"C:\Qt\<your Qt API version>\lib\"[/i]). I can find them for you, but their exact location depends on several things like where you installed Qt.

[b][Edit:][/b] I'll try harder to explain their location tomorrow when I have time. Edited by Servant of the Lord
1

Share this post


Link to post
Share on other sites
An alternative would be to add -static-libgcc and -static-libstdc++ to the compiler parameters (not sure where exactly to do that in QtCreator).

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.
1

Share this post


Link to post
Share on other sites
Alright, let's try this: Do you know where your "Computer" folder is? If it's not on your desktop, it's available from your start menu:
[hr]
[rollup="Finding the C:/ drive"]
[img]http://img222.imageshack.us/img222/208/startmenu20120829103014.png[/img]
[img]http://img59.imageshack.us/img59/3742/computer20120829102653.png[/img]
[/rollup]

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 [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img]).

For me, I can find mine here: [b]C:\Qt\<qt version>\bin[/b]
And here (different install): [b]C:\QtSDK\Desktop\Qt\<qt version>\mingw\bin [color=#ff0000]<-- This is probably your install ([size=2]my mistake with the earlier suggested path[/size]).[/color][/b]

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 [i]possible [/i]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).

[hr]
[b]Possible path:[/b]
[rollup="Step 1"]
[img]http://img222.imageshack.us/img222/682/operatingsystemc2012082.png[/img][/rollup]
[rollup="Step 2"][img]http://img84.imageshack.us/img84/435/qtsdk20120829102705.png[/img][/rollup]
[rollup="Step 3"][img]http://img600.imageshack.us/img600/544/desktop20120829102711.png[/img][/rollup]
[rollup="Step 4"][img]http://img266.imageshack.us/img266/3296/qt20120829102716.png[/img][/rollup]
[rollup="Step 5"][img]http://img269.imageshack.us/img269/4905/44461260.png[/img][/rollup]
[rollup="Step 6"][img]http://img59.imageshack.us/img59/2729/mingw20120829102724.png[/img][/rollup]
[rollup="Step 7"]The highlighted files are (some of) the ones you need. COPY do not cut or delete. Copy them to the same folder with your game executable.[img]http://img138.imageshack.us/img138/3999/bin20120829102750.png[/img][/rollup]

[hr]

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
1

Share this post


Link to post
Share on other sites
If you can't find the Qt DLLs following the excellent description by Servant of the Lord, another tip from me:
- 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.
2

Share this post


Link to post
Share on other sites
Congrats! That was located at [b]C:\QtSDK\Desktop\Qt\<qt version>\mingw\bin[/b]

Now we need to go to [b]C:\QtSDK\mingw\bin[/b]

The DLLs you want are:[list]
[*][b]libgcc_s_dw2-1.dll[/b]
[*][b]libstdc++-6.dll[/b]
[*][b]mingwm10.dll[/b]
[/list]
Probably. I forget which ones are actually required, but grabbing all three won't hurt. Copy and Paste them into your game's folder.

[size=5][b]You should have:[/b][/size]

Your stuff:[list]
[*][b]your-game.exe[/b] ([size=2]whatever you name it is fine, as long as it ends in .exe (if you have extensions visible)[/size])
[*][b]Your game's data files[/b] ([size=2]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[/size])
[/list]
MinGW/GCC and C++ stuff:[list]
[*][b]libgcc_s_dw2-1.dll [/b] (the names matter, keep them as-is)
[*][b]libstdc++-6.dll[/b]
[*][b]mingwm10.dll[/b]
[/list]
Qt stuff: (if your game was built [u]without[/u] debugging information)[list]
[*][b]QtGui4.dll[/b]
[*][b]QtCore4.dll[/b]
[/list]
Qt stuff: (if your game was built [u]with[/u] debugging information)[list]
[*][b]QtGuid4.dll[/b]
[*][b]QtCored4.dll[/b]
[/list]
All the DLLs need to be in the same folder with your game. Then run your game, and if you get a message like ""The program can't start because <some DLL file> is missing from your computer", post the message, and we'll help you find the 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
1

Share this post


Link to post
Share on other sites
I can't believe it!!!!!!! It works now!!!! Yeeeeaaaahhhhhh! Thanks soo much man! So this will work for all of my applications?
1

Share this post


Link to post
Share on other sites
Awesomeness! I'm glad it worked. [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]

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 [b]statically [/b]link (meaning the library code is mixed into your executable itself), and some [b]dynamically [/b]link (meaning the library code is in the DLLs - [i][b]D[/b]ynamically [b]L[/b]inked [b]L[/b]ibrary[/i]). 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 ([b]QtCore4.dll[/b] = 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 [i]from[/i] SFML, 2 other libraries required [i]by[/i] 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 [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img] (it uses the Unreal Engine, and most of the DLLs are from that). Sometimes a DLL is really small and other times they can be quire large.

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 [i]probably[/i] only need:[list]
[*]libstdc++-6.dll
[*]QtGuid4.dll
[*]QtCored4.dll
[/list]

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 [url="http://www.dependencywalker.com/"]Dependency Walker[/url] which tells you what DLLs your program needs. Edited by Servant of the Lord
0

Share this post


Link to post
Share on other sites
Wow thanks for all this knoledge! I'll definitely be checking back here if I ever have trouble again hahaha Also as just a tip, how hard was it to line SFML up with QT and have it run properly? I tried to do it before but it didn't work out at all':/ but as you probably know already, I have no idea what I'm doing when I'm trying to connect stuff together hahahaha
0

Share this post


Link to post
Share on other sites
It wasn't too hard to get them working together - the hard part that they both have different programming styles and paradigms that don't line up too well with each other, so I find myself constantly having to switch between two distinct styles of architecture in the same project - one style must dominate, and unfortunately the one I didn't want was the one that exerted the most influence on my code. If I was to do it again (or refactor what I currently have), I could probably make it work alot better, but it's just something to be aware of.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0