0

How can i run a program which already has been built and compiled before on Qt IDE, so that i can take that program and run on any computer I want without recompiling it on that computer. I am a beginner so bare answering this question.:)

Thanks

3
  • what do you want to run it from? If you're in the terminal on Linux/Mac all you have to do is go to the executable file's directory and ./<executable> to run it. Commented Mar 8, 2012 at 14:45
  • Yeah i want to click on executable (in debug folder) made by IDE to lauch the program. But in windows when i click it, it gives error and doesn't launch it. Commented Mar 8, 2012 at 14:48
  • you should be able to run it through the command line. Go to the folder from the command line and run the executable just like in Linux. Commented Mar 8, 2012 at 14:52

3 Answers 3

2

There are a few parts to your problem.

1) You need to compile it for each architecture you want it to be used on.

2) Each architecture will have a set of Qt dynamic libraries associated with it too that need to be available.

3) Some architectures have an easy-to-deploy mechanism. EG, on a mac you can run "macdeployqt" to get the libraries into the application directory. For nokia phones (symbian, harmattan (N9), etc) QtCreator has a deploy step that will build a package for the phone and even include an icon.

4) For systems without such a feature, like linux and windows, you'll either need to distribute the binary and require the user to have Qt available or to package up a directory/zip containing the needed Qt libraries and distribute that.

Sign up to request clarification or add additional context in comments.

3 Comments

I am going to run it on all windows OS machines. the program i made was also compiled on Windows! So what libraries should i keep with my program to run it on other pcs without recompiling?
It depends on the modules you required in your .pro file. Typically, start with the minimum and go from there as when you run it (in a console) you'll actually get an error telling you what's missing.
I added a link to the windows word so that it takes you to a page describing your options on windows specifically.
1

It doesn't launch because it cannot find the dependencies. As you are on Windows, these libraries can be moved in the same directory as your application. To find which library is missing, use dependency walker

I am pretty sure these libraries are not found:

  • The Qt dynamic libraries (can be found on Qt bin directory, take the dll)
  • The C dynamic libraries used for compilation. If you are on creator and use default setting it will be mingw-xxx(can be found in the Qt installation directory, don t know exactly where)

Comments

-1

Every Architect has a set of CPU Instructions.

so it's like when you hear a language that you don't understand. like when i speak Arabic To Someone who don't Understand The Language.

Every Architect Has a set of Processor Instructions, The Compiler only convert the code into instruction only understood by The Architecture that your CPU is.

That's Why Python and the most of High level languages Use Interpreter Instead of a Compiler.

But There are some cross compilers like MinGw that Support Cross compiling To Windows (.exe files)

Simply QT Have some libraries important to be in the working directory for your project.

1 Comment

The question was not "why something happens", but "what to do".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.