Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, June 2007
How do I create a standalone binary in Mac OS X/XCode ?


Message 1 in thread

I used the .dmg to install Qt

Is that my first mistake ?  Do I need to build a static environment  
from source ?

If not, any other Mac users out there who can clue me in about  
project settings ?

Thanks. 

--
 [ signature omitted ] 

Message 2 in thread

To create stand alone executables, I start with the source  
distribution. Use the -static and -no-framework options to configure.  
For example, on my system:

I extract the source into \Developer\qt43

Then go to terminal, navigate to this directory and I run:

./configure -release -static -no-exceptions -qt-gif -qt-libjpeg -no- 
framework -universal -qt-sql-sqlite -sdk /Developer/SDKs/ 
MacOSX10.4u.sdk -prefix /Developer/qt43

For "My" purposes, this gives me SQLite, and .gif and .jpeg support  
"built in". I also make universal binaries and use the OSX10.4 sdk  
(for Tiger deployment).

After a good while, it will finish building. Then run

sudo make install

A few minutes later your ready to go. You will also need to edit  
your .profile file yourself. From terminal, type
pico .profile

Then add the lines:

PATH=$PATH:/Developer/qt43/bin
export PATH

Ctrl-O writes the file
Ctrl-X exits pico

restart a terminal window and you are ready to make .pro files, run  
qmake, and then make to create and build your projects.

To create an XCode project from a .pro file, just type (on the  
command line in terminal):

qmake -spec macx-xcode YOURPROJECT.pro

Projects built this way will require no extra frameworks be embedded  
and will run on Tiger just fine (and so far mostly Leopard ;-)  XCode  
makes it easier (at least for me) to debug my projects, and twiddle  
with advanced compiler options, etc.

There are dozens, nay, hundreds of variations, and some of the people  
on this list may well chime in with some interesting variations. For  
my specific needs, this does the trick.

Richard
P.S. In the qt43/bin directory, you'll find a program called  
"Assistant"... this is your best friend.



On Jun 25, 2007, at 8:06 PM, Dan White wrote:

> I used the .dmg to install Qt
>
> Is that my first mistake ?  Do I need to build a static environment  
> from source ?
>
> If not, any other Mac users out there who can clue me in about  
> project settings ?
>
> Thanks.
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

--
 [ signature omitted ] 

Message 3 in thread

On OSX commercial, the .dmg installer installs this stuff in very  
different places.

Richard, I like your instructions here.  I've had alot of problems  
getting QT 4.3 commercial to work and I'm using the straight .dmg  
installer.

One of the things I have noticed about QT for the Mac is that it  
always builds a xcode project when qmake is run.  I think this should  
be flagged as a bug.  It is not consistent with Windows or Linux.  If  
I run qmake && make/nmake on Windows or Linux, I get my .pro files  
built.  I don't have to be a platform expert to get the job done.   
Under OSX, I get an xcode project and I always get errors on the  
builds.  Various things can't be found and it is never the same thing.

I think that the behavior of qmake on Mac should be qmake -t xcode  
should make an xcode project. QMake by itself should create a make  
file.  If I want a solution file on Windows, I type qmake -t vcapp.

OSX does not behave in the fashion that I would expect it to.  Case  
in point, I've retrieved the webkit QT files.  I have to run a build  
script to built it.  Yet in each directory, there are .pro files.   
I've run qmake on them and it places a xcode project in the various  
directories yet none of them will build.  If I run the build script,  
it builds.  These nits are annoying and means I have to become a  
tools expert on MacOSX.

Richard, your solution of building static and no framework is great.   
The app should then run without mucking around with frameworks.

M


On Jun 25, 2007, at 9:57 PM, Richard S. Wright Jr. wrote:

> To create stand alone executables, I start with the source  
> distribution. Use the -static and -no-framework options to  
> configure. For example, on my system:
>
> I extract the source into \Developer\qt43
>
> Then go to terminal, navigate to this directory and I run:
>
> ./configure -release -static -no-exceptions -qt-gif -qt-libjpeg -no- 
> framework -universal -qt-sql-sqlite -sdk /Developer/SDKs/ 
> MacOSX10.4u.sdk -prefix /Developer/qt43
>
> For "My" purposes, this gives me SQLite, and .gif and .jpeg support  
> "built in". I also make universal binaries and use the OSX10.4 sdk  
> (for Tiger deployment).
>
> After a good while, it will finish building. Then run
>
> sudo make install
>
> A few minutes later your ready to go. You will also need to edit  
> your .profile file yourself. From terminal, type
> pico .profile
>
> Then add the lines:
>
> PATH=$PATH:/Developer/qt43/bin
> export PATH
>
> Ctrl-O writes the file
> Ctrl-X exits pico
>
> restart a terminal window and you are ready to make .pro files, run  
> qmake, and then make to create and build your projects.
>
> To create an XCode project from a .pro file, just type (on the  
> command line in terminal):
>
> qmake -spec macx-xcode YOURPROJECT.pro
>
> Projects built this way will require no extra frameworks be  
> embedded and will run on Tiger just fine (and so far mostly  
> Leopard ;-)  XCode makes it easier (at least for me) to debug my  
> projects, and twiddle with advanced compiler options, etc.
>
> There are dozens, nay, hundreds of variations, and some of the  
> people on this list may well chime in with some interesting  
> variations. For my specific needs, this does the trick.
>
> Richard
> P.S. In the qt43/bin directory, you'll find a program called  
> "Assistant"... this is your best friend.
>
>
>
> On Jun 25, 2007, at 8:06 PM, Dan White wrote:
>
>> I used the .dmg to install Qt
>>
>> Is that my first mistake ?  Do I need to build a static  
>> environment from source ?
>>
>> If not, any other Mac users out there who can clue me in about  
>> project settings ?
>>
>> Thanks.
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>> with "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

--
 [ signature omitted ] 

Message 4 in thread

Michael,

I'm glad you found this useful.

Unfortunately, I cannot verify your bug of always making xcode  
projects. I have never observed this behavior, and I just double  
checked and I'm not getting it now. I have to specifically do this:

qmake -spec macx-xcode YOURPROJECT.pro

to get an XCode project.

My previous instructions had a typo... I extract initially into

/Developer/Qt43src

Installing into the build directory "probably" works, but I haven't  
tried it. This was the quickest and easiest way to get some remote  
people on my team new to the Mac up and running and building things  
on their own AND able to try the binaries on other non-development Macs.

I like it partly too because it's just less hassle ;-)

Richard



On Jun 26, 2007, at 7:20 PM, Michael Simpson wrote:

> On OSX commercial, the .dmg installer installs this stuff in very  
> different places.
>
> Richard, I like your instructions here.  I've had alot of problems  
> getting QT 4.3 commercial to work and I'm using the straight .dmg  
> installer.
>
> One of the things I have noticed about QT for the Mac is that it  
> always builds a xcode project when qmake is run.  I think this  
> should be flagged as a bug.  It is not consistent with Windows or  
> Linux.  If I run qmake && make/nmake on Windows or Linux, I get  
> my .pro files built.  I don't have to be a platform expert to get  
> the job done.  Under OSX, I get an xcode project and I always get  
> errors on the builds.  Various things can't be found and it is  
> never the same thing.
>
> I think that the behavior of qmake on Mac should be qmake -t xcode  
> should make an xcode project. QMake by itself should create a make  
> file.  If I want a solution file on Windows, I type qmake -t vcapp.
>
> OSX does not behave in the fashion that I would expect it to.  Case  
> in point, I've retrieved the webkit QT files.  I have to run a  
> build script to built it.  Yet in each directory, there are .pro  
> files.  I've run qmake on them and it places a xcode project in the  
> various directories yet none of them will build.  If I run the  
> build script, it builds.  These nits are annoying and means I have  
> to become a tools expert on MacOSX.
>
> Richard, your solution of building static and no framework is  
> great.  The app should then run without mucking around with  
> frameworks.
>
> M
>
>
> On Jun 25, 2007, at 9:57 PM, Richard S. Wright Jr. wrote:
>
>> To create stand alone executables, I start with the source  
>> distribution. Use the -static and -no-framework options to  
>> configure. For example, on my system:
>>
>> I extract the source into \Developer\qt43
>>
>> Then go to terminal, navigate to this directory and I run:
>>
>> ./configure -release -static -no-exceptions -qt-gif -qt-libjpeg - 
>> no-framework -universal -qt-sql-sqlite -sdk /Developer/SDKs/ 
>> MacOSX10.4u.sdk -prefix /Developer/qt43
>>
>> For "My" purposes, this gives me SQLite, and .gif and .jpeg  
>> support "built in". I also make universal binaries and use the  
>> OSX10.4 sdk (for Tiger deployment).
>>
>> After a good while, it will finish building. Then run
>>
>> sudo make install
>>
>> A few minutes later your ready to go. You will also need to edit  
>> your .profile file yourself. From terminal, type
>> pico .profile
>>
>> Then add the lines:
>>
>> PATH=$PATH:/Developer/qt43/bin
>> export PATH
>>
>> Ctrl-O writes the file
>> Ctrl-X exits pico
>>
>> restart a terminal window and you are ready to make .pro files,  
>> run qmake, and then make to create and build your projects.
>>
>> To create an XCode project from a .pro file, just type (on the  
>> command line in terminal):
>>
>> qmake -spec macx-xcode YOURPROJECT.pro
>>
>> Projects built this way will require no extra frameworks be  
>> embedded and will run on Tiger just fine (and so far mostly  
>> Leopard ;-)  XCode makes it easier (at least for me) to debug my  
>> projects, and twiddle with advanced compiler options, etc.
>>
>> There are dozens, nay, hundreds of variations, and some of the  
>> people on this list may well chime in with some interesting  
>> variations. For my specific needs, this does the trick.
>>
>> Richard
>> P.S. In the qt43/bin directory, you'll find a program called  
>> "Assistant"... this is your best friend.
>>
>>
>>
>> On Jun 25, 2007, at 8:06 PM, Dan White wrote:
>>
>>> I used the .dmg to install Qt
>>>
>>> Is that my first mistake ?  Do I need to build a static  
>>> environment from source ?
>>>
>>> If not, any other Mac users out there who can clue me in about  
>>> project settings ?
>>>
>>> Thanks.
>>> --
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>>> with "unsubscribe" in the subject or the body.
>>> List archive and information: http://lists.trolltech.com/qt- 
>>> interest/
>>>
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>> with "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

--
 [ signature omitted ] 

Message 5 in thread

Well, I used .dmg to install, too, and it works without problem. The
question is what is your exact problem.


Christian Rengstl M.A.
Klinik und Poliklinik fÃr Innere Medizin II
Kardiologie - Forschung
UniversitÃtsklinikum Regensburg
B3 1.388
Franz-Josef-Strauss-Allee 11
93053 Regensburg
Tel.: +49-941-944-7230


>>> On Tue, Jun 26, 2007 at  2:06 AM, in message
<E7BB3F80-BB8C-48E3-B7B8-EFBF24EC96A8@xxxxxxxxxxx>, Dan White
<ygor@xxxxxxxxxxx> wrote: 
> I used the .dmg to install Qt
> 
> Is that my first mistake ?  Do I need to build a static environment 

> from source ?
> 
> If not, any other Mac users out there who can clue me in about  
> project settings ?
> 
> Thanks. 
> 
> --
> To unsubscribe -  send a mail to qt- interest- request@xxxxxxxxxxxxx
with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-
interest/

--
 [ signature omitted ] 

Message 6 in thread

Hey,

I had no problems following the instructions in the Qt Assistant, topic:
Deploying an Application on Qt/Mac

I also used the .dmg installer of Qt.

Hope this helps.

best regards

seb


On Tuesday 26 June 2007 02:06:57 Dan White wrote:
> I used the .dmg to install Qt
>
> Is that my first mistake ?  Do I need to build a static environment
>
> >from source ?
>
> If not, any other Mac users out there who can clue me in about
> project settings ?
>
> Thanks.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/


--
 [ signature omitted ] 

Message 7 in thread

On Mon, Jun 25, Dan White wrote:

> I used the .dmg to install Qt
> 
> Is that my first mistake ?  Do I need to build a static environment  
> from source ?
> 
> If not, any other Mac users out there who can clue me in about  
> project settings ?
> 

No, you don't need a static environment. But if users of your app don't
have Qt installed, they will need the frameworks within the application
bundle.

There is a script which automates the steps explained in the Qt-docs:

http://wiki.qtcentre.org/index.php?title=Mac_OS_X_Deployment_Script


Uwe 

-- 
 [ signature omitted ] 

Message 8 in thread

The problem is that if I copy the resulting application to another Mac it will not run if Qt has not been installed.

I have received several responses with information and links.  It's going to take me a few days to work through it all.  I will be happy to post the end results.

My thanks to all that responded.

 -------------- Original message ----------------------
From: "Christian Rengstl" <Christian.Rengstl@xxxxxxxxxxxxxxxxxxxxxxxx>
> Well, I used .dmg to install, too, and it works without problem. The
> question is what is your exact problem.
> 
> 
> Christian Rengstl M.A.
> Klinik und Poliklinik für Innere Medizin II
> Kardiologie - Forschung
> Universitätsklinikum Regensburg
> B3 1.388
> Franz-Josef-Strauss-Allee 11
> 93053 Regensburg
> Tel.: +49-941-944-7230
> 
> 
> >>> On Tue, Jun 26, 2007 at  2:06 AM, in message
> <E7BB3F80-BB8C-48E3-B7B8-EFBF24EC96A8@xxxxxxxxxxx>, Dan White
> <ygor@xxxxxxxxxxx> wrote: 
> > I used the .dmg to install Qt
> > 
> > Is that my first mistake ?  Do I need to build a static environment 
> 
> > from source ?
> > 
> > If not, any other Mac users out there who can clue me in about  
> > project settings ?
> > 
> > Thanks. 
> > 
> > --
> > To unsubscribe -  send a mail to qt- interest- request@xxxxxxxxxxxxx
> with 
> > "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-
> interest/
> 

--
 [ signature omitted ] 

Message 9 in thread

	
On Jun 26, 2007, at 2:49 PM, ygor@xxxxxxxxxxx wrote:

> The problem is that if I copy the resulting application to another  
> Mac it will not run if Qt has not been installed.
>
> I have received several responses with information and links.  It's  
> going to take me a few days to work through it all.  I will be  
> happy to post the end results.

Well, if you didn't follow all steps in documentation ("Deploying an  
Application on Qt/Mac) then for sure it won't work if there isn't  
installed Qt. Please read this chapter in documentation first.

--
 [ signature omitted ] 

Message 10 in thread

I followed the instructions in assistant for deploying applications on
Mac and it worked very well. Did you copy the dylib files into your .app
directory?


Christian Rengstl M.A.
Klinik und Poliklinik fÃr Innere Medizin II
Kardiologie - Forschung
UniversitÃtsklinikum Regensburg
B3 1.388
Franz-Josef-Strauss-Allee 11
93053 Regensburg
Tel.: +49-941-944-7230


>>> On Tue, Jun 26, 2007 at  2:49 PM, in message
<062620071249.3470.46810B40000A539C00000D8E22007614389D010997@xxxxxxxxxxx>,
<ygor@xxxxxxxxxxx> wrote: 
> The problem is that if I copy the resulting application to another
Mac it 
> will not run if Qt has not been installed.
> 
> I have received several responses with information and links.  It's
going to 
> take me a few days to work through it all.  I will be happy to post
the end 
> results.
> 
> My thanks to all that responded.
> 
>  --------------  Original message ----------------------
> From: "Christian Rengstl" <Christian.Rengstl@xxxxxxxxxxx
regensburg.de>
>> Well, I used .dmg to install, too, and it works without problem.
The
>> question is what is your exact problem.
>> 
>> 
>> Christian Rengstl M.A.
>> Klinik und Poliklinik fââr Innere Medizin II
>> Kardiologie -  Forschung
>> UniversitâÃtsklinikum Regensburg
>> B3 1.388
>> Franz- Josef- Strauss- Allee 11
>> 93053 Regensburg
>> Tel.: +49- 941- 944- 7230
>> 
>> 
>> >>> On Tue, Jun 26, 2007 at  2:06 AM, in message
>> <E7BB3F80- BB8C- 48E3- B7B8- EFBF24EC96A8@xxxxxxxxxxx>, Dan White
>> <ygor@xxxxxxxxxxx> wrote: 
>> > I used the .dmg to install Qt
>> > 
>> > Is that my first mistake ?  Do I need to build a static
environment 
>> 
>> > from source ?
>> > 
>> > If not, any other Mac users out there who can clue me in about  
>> > project settings ?
>> > 
>> > Thanks. 
>> > 
>> > --
>> > To unsubscribe -   send a mail to qt-  interest- 
request@xxxxxxxxxxxxx
>> with 
>> > "unsubscribe" in the subject or the body.
>> > List archive and information: http://lists.trolltech.com/qt-
>> interest/
>> 

--
 [ signature omitted ] 

Message 11 in thread

I tried this by hand and could not get it to work.
I believe I'll try the script.

Thanks.
 -------------- Original message ----------------------
From: "Uwe Drechsel (@vym)" <vym@xxxxxxxxxxxxx>
> On Mon, Jun 25, Dan White wrote:
> 
> > I used the .dmg to install Qt
> > 
> > Is that my first mistake ?  Do I need to build a static environment  
> > from source ?
> > 
> > If not, any other Mac users out there who can clue me in about  
> > project settings ?
> > 
> 
> No, you don't need a static environment. But if users of your app don't
> have Qt installed, they will need the frameworks within the application
> bundle.
> 
> There is a script which automates the steps explained in the Qt-docs:
> 
> http://wiki.qtcentre.org/index.php?title=Mac_OS_X_Deployment_Script
> 
> 
> Uwe 
> 
> -- 
> mathematician, n:
> 	Some one who believes imaginary things appear right before your i's.
> 
> 
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> 

--
 [ signature omitted ]