PDA

View Full Version : 2 basic questions?



unix7777
20th January 2010, 14:38
I have 2 simple questions, which answers will help me a lot:

1.I use QT 4.6 on Mac OS X 10.6, i use QT Creator to make UI and to edit the code.I set the project builder to Release(not debug),
after successful compiling the resulted file example.app doesn't work on another Mac without QT.Does somebody can explain the steps of
compiling on Mac OS?Is it possible to compile directly from QT Creator or is necessary t make it in Terminal qmake make...?

2.What is the difference in writing and mostly compiling QT 32 or 64bit application?

boudie
20th January 2010, 14:56
Read this and your problem will be solved:
http://doc.trolltech.com/4.6/deployment.html

unix7777
20th January 2010, 17:26
Thanks for the ink, i review it but there is a real mess.Mainly i do the following:
1.Configure all building settings to release not to debug mode
2.i open the Terminal int the directory of the project and type: qmake projectname.pro
3.than tyme make
4.the generated projectname.app doesn' work on another Mac.

HELP?

ChrisW67
21st January 2010, 01:59
The most likely reason is that you have not shipped the Qt libraries used by your application with the application (not a Mac person but UNIXes usually have a utility called "ldd" that would help). If you have the main libraries, then the next most likely thing is missing plugins. It's also possible you have shipped the wrong set of runtime libraries from the two included in the QtCreator SDK bundle.

Since you you don't tell us exactly how it "doesn't work" it is very difficult to be more specific.


Your second question: Not much although I'm not sure what you mean by "mostly compiling". Qt and QtCreator is built with a compiler generating 32- or 64-bit code, and ultimately generates 32- or 64-bit binaries from from your source. You ship matching runtime libraries with your app either way. There are some source code portability issues to be aware of. For example, you need to be aware that the size of an "int" might change and that's why Qt gives you qint32 and friends, which is guaranteed to be 32 bits regardless.

unix7777
21st January 2010, 08:45
At first, thank you very much for your response!!!!
I new that to generate independent application QT must me with static libraries.The SDK binary that i currently use is with dynamic.I tried to compile QT with static by my self following the instructions in QT site, but errors occur.
My question is: is there any binary with static libraries for Mac OS?Or if i use the SDK(with dinamic) how can i compile independent application that run on every Mac?

About 32/64 bit application, how can i set to be 64?

ChrisW67
28th January 2010, 09:44
AFAIK you will have to built Qt from source to enable static linking. All the SDK bundles are dynamic linking only.

I thought the default tool chain on OS X (10.5+) was 64-bit. If that's the case then it is probably building 64-bit executables by default. As I understand it the Apple c++ compiler is a GCC derivative so you should try to build 32-bit code with "cc -m32" and 64-bit without the flag or with "cc -m64".

You will need someone with a Mac to help you any more though.