PDA

View Full Version : compiling



InterFiction
16th November 2011, 13:08
I'm trying to learn to compile projects into an exe file, but I'm having a hard time doing it. I'm not sure what to do. lol, even when programming console apps I never built an exe, I was just learning the language...but anyway

I was messing around in MinGW, and finally ended up with an exe file in my Debug folder for the project. When I tried to run it I got and error saying something like "mingWM10.dll" is missing..

I'm not sure about how to compile the project right..

any ideas?

Lykurg
16th November 2011, 13:54
The compilation went fine, but you have to ensure that the application can find its needed dlls. So have a look at the documentation on how to deploy a win application. It is very well described there.

InterFiction
16th November 2011, 14:26
Hey thanks. You wouldn't happen to have a link for the online documentation to the section I need? I've got a copy of the qt creator documentation here, but I don't know where to click in the documentation, or if I'm even looking at the right documentation for what you were talking about, lol.


this is the doc from QTcreator is that what you're talking about?

Introducing Qt Creator
Qt Creator User Interface
Getting Started
Building and Running an Example Application
Creating a Qt Quick Application
Creating a Qt Quick Application Using Qt Quick Components
Creating a Qt Widget Based Application
Creating a Qt Widget Based Mobile Application
Managing Projects
Creating a Project
Opening a Project
Adding Libraries to Projects
Connecting MeeGo Harmattan Devices
Connecting Generic Linux Devices
Connecting Maemo Devices
Connecting Symbian Devices
Managing Sessions
Coding
Using the Editor
Semantic Highlighting
Checking Code Syntax
Completing Code
Indenting Code
Finding and Replacing
Refactoring
Using Qt Quick Toolbars
Searching With the Locator
Pasting and Fetching Code Snippets
Using Text Editing Macros
Configuring the Editor
Using FakeVim Mode
Developing Application UI
Developing Qt Quick Applications
Creating Qt Quick Projects
Using Qt Quick Designer
Creating Components
Creating Buttons
Creating Scalable Buttons and Borders
Creating Screens
Animating Screens
Adding User Interaction Methods
Exporting Designs from Graphics Software
Implementing Application Logic
Using QML Modules with Plugins
Developing Widget Based Applications
Optimizing Applications for Mobile Devices
Building and Running Applications
Building Applications for Multiple Targets
Running Applications on Multiple Targets
Specifying Build Settings
Adding Qt Versions
Adding Tool Chains
Specifying Run Settings
Specifying Editor Settings
Specifying Code Style Settings
Specifying Dependencies
Debugging
Debugging the Example Application
Launching the Debugger
Interacting with the Debugger
Setting Up Debugger
Using Debugging Helpers
Debugging Qt Quick Projects
Troubleshooting Debugger
Analyzing Code
Profiling QML Applications
Detecting Memory Leaks
Profiling Function Execution
Running Valgrind Tools Remotely
Deploying Applications to Mobile Devices
Deploying Applications to Symbian Devices
Deploying Applications to Maemo or MeeGo Harmattan Devices
Publishing Maemo Applications to Extras-devel
Publishing Applications to Ovi Store
Building with Remote Compiler
Getting Help
Advanced Use
Operating Systems and Supported Platforms
Adding New Custom Wizards
Setting Up a CMake Project
Setting Up a Generic Project
Using Version Control Systems
Adding Qt Designer Plugins
Using External Tools
Using Maemo or MeeGo Harmattan Emulator
Editing MIME Types
Showing Task List Files in the Build Issues Pane
Using Command Line Options
Keyboard Shortcuts
FAQ
Tips and Tricks
Known Issues
Technical Support
Glossary
Acknowledgements

Lykurg
16th November 2011, 15:37
look here: http://doc.qt.nokia.com/latest/deployment.html and here: http://doc.qt.nokia.com/latest/deployment-windows.html

If you can't find anything in the documentation, google is your friend.

InterFiction
16th November 2011, 16:55
Hey, thanks for the links. I'll have a look through, and see what I can find. I've already tried Google, I find the links, and information a bit confusing..most of it aimed at people that know what they're doing, lol, that's why I posted here...I'm gonna read through the links though, thanks.

Added after 42 minutes:

Hey, I'm trying to follow along with the second link. I've got MinGW open. it says to go to the dir of qt. I've done that. on this pc it's C:\QtSDK\QtCreator\bin\ . That's where the exe file for qt creator is. It says to type a configure command, and then nmake sub-src to configure, and build qt statically...

when ever I type these commands into MinGW it says they are not internal or external commands, operable programs, or batch files.. Something like that...

any ideas on how to fix this?

Lykurg
16th November 2011, 19:01
Ahh, first read, then go to action! You don't need to build Qt static! What you are looking for is at the bottom of the page. You successfully build your app. Fine, now you just have to deploy it alongside the right dlls. So make a new directory and copy the exe there.

Start the exe -> mingw.dll is missing
copy the mingw.dll to the directory
Start the exe -> QtCore.dll is missing
copy the QtCore.dll in the directory
...


http://doc.qt.nokia.com/latest/deployment-windows.html#creating-the-application-package and
http://doc.qt.nokia.com/latest/deployment-windows.html#application-dependencies

InterFiction
16th November 2011, 22:32
ohh okay, I see what you're saying, haha, sorry about that. Just kinda excited to get it going. I'll read the links you gave a bit more, before I post again, thanks for the info.

Added after 17 minutes:

I used that walker tool. It's telling me what I need, but I don't know where to find the files. Are they all stored in one location

Added after 15 minutes:

okay, I've got some of the dlls found in the bin directory coppied over into the root dir of my app, but there's two that aren't there. They aren't in the bin dir of qt..is there a safe place to find the ones that aren't on my computer? MINGWM10 is missing, and LIBGCC_S_DW2-1 is missing.

ChrisW67
16th November 2011, 22:54
Both of those files are on your computer. They are shipped with the MingW compiler suite, either in the Qt SDK bundle or a standalone MingW installation. Look in the mingw/bin folder.

InterFiction
16th November 2011, 23:35
Hey thanks for the info. That's where it was. You'll have to forgive me. I've never done this before. I searched through start and it didn't turn up nothing, look around in the folders a bit, but couldn't find it..it was there though, thanks.

Added after 7 minutes:

Hey, now that I've found them all, and understand how to find them, lol, I've got them into my project folder, and the app works. Thanks guys. That leads me to a new question. Is there a way to place these in another folder in my root so that the program still finds them. That way everything can be organized, or is this something that has to be done programatically?

ChrisW67
17th November 2011, 02:48
If you are using Qt Creator then these files should be found when you run the program from within the IDE - development does not require moving the files. If you want to run the program outside of the IDE during dev I would suggest you add the MingW bin and Qt bin directories to the system path rather than copying the files elsewhere on your system.

When you deploy the application you will have to place the files on the target computer using your installer of choice. I would recommend putting the two MingW/GCC and Qt library files in the same directory as your application and not in a system location.

Urthas
17th November 2011, 07:27
You might also consider an external tool which is very simple to use, such as HM NIS Edit (http://hmne.sourceforge.net/). This is actually very nice because it generates an installation wizard that Windows users will be familiar with. You still have to know what and where the pertinent .dll files are on your system though, so this thread is still quite useful. Make sure that when you are ready to deploy you toggle from debug to release build targets in Qt Creator.

Setting up on the one hand and deploying on the other are to me the hardest things to settle into, so I appreciate threads like this. Thanks.