Results 1 to 6 of 6

Thread: 2 basic questions?

  1. #1
    Join Date
    Mar 2009
    Posts
    104
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Question 2 basic questions?

    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?

  2. #2
    Join Date
    Jan 2009
    Location
    The Netherlands and Spain
    Posts
    150
    Thanks
    6
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: 2 basic questions?

    Read this and your problem will be solved:
    http://doc.trolltech.com/4.6/deployment.html

  3. #3
    Join Date
    Mar 2009
    Posts
    104
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: 2 basic questions?

    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?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: 2 basic questions?

    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.

  5. #5
    Join Date
    Mar 2009
    Posts
    104
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: 2 basic questions?

    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?

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: 2 basic questions?

    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.

Similar Threads

  1. Need basic help
    By Ossi in forum Qwt
    Replies: 2
    Last Post: 23rd October 2009, 13:24
  2. Basic Qt Questions
    By BalaQT in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2009, 17:13
  3. a basic questions!!
    By unix7777 in forum Newbie
    Replies: 1
    Last Post: 28th March 2009, 19:10
  4. Need immediate help on basic cpp
    By Sandip in forum General Programming
    Replies: 10
    Last Post: 21st September 2008, 10:33
  5. Qt/C++ basic Q-s
    By jamadagni in forum General Programming
    Replies: 9
    Last Post: 10th February 2006, 08:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.