Thread: [gtk+osx] Compiling GTK Helloworld GTK app on MAC
Status: Beta
Brought to you by:
jralls
From: John B. <nou...@gm...> - 2005-03-09 05:06:49
|
Hey all, This is a down and dirty guide to compiling some of your own custom gtk apps on your machine. First and foremost you need to have Fink and X11 installed along with X11 sdk. The sdk can be found in the xtools developer package. Once you have all those things downloaded you will want to download and install all the "gtk+" files you see when you do a "fink list". Once thats complete the tutorial for compiling gtk apps will tell you to use the following command to compile your gtk helloworld.c. gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags gtk+-2.0``pkg-config --libs gtk+-2.0` make sure you change it to this gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags gtk+-2.0``pkg-config --libs gtk+-2.0` -I/sw/lib note the difference on the end is -I/sw/lib which is where fink puts the gtk libs. Im not totally sure if you need to download a gtk dependent program using either fink or apt-get but you might have too. I think I did gftp before I even attempted any of this. In any case I think this should work for most of you, if you are having trouble email me and I will try and help you. The most important thing to do is try and use fink to download and compile a GTK dependent app like gftp and if thats working then do the gtk+ libs that I talked about and the compile instructions I wrote up above, those things should pretty much guarantee that you can compile your own gtk apps and run them with X11 John |
From: Andy P. <en...@li...> - 2005-03-10 16:42:27
|
John, Thanks for the info. Just to be clear, the goal of this project is to port gtk+ natively to the Mac, by replacing gtk's low level X11 API layer with our own native Carbon API layer. This removes any dependence upon fink, darwinports, or X11, for gtk+ based apps on the Mac. There is further documentation as well as example source code, in the package on the website, on how to compile and use the gtk-osx distribution. Thanks, Andy John Bender wrote: > Hey all, > > This is a down and dirty guide to compiling some of your own custom gtk > apps on your machine. First and foremost you need to have Fink and X11 > installed along with X11 sdk. > The sdk can be found in the xtools developer package. Once you have all > those things downloaded you will want to download and install all the > "gtk+" files you see when you do a "fink list". Once thats complete the > tutorial for compiling gtk apps will tell you to use the following > command to compile your gtk helloworld.c. > > gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags > gtk+-2.0``pkg-config --libs gtk+-2.0` > > make sure you change it to this > > gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags > gtk+-2.0``pkg-config --libs gtk+-2.0` -I/sw/lib > > note the difference on the end is -I/sw/lib which is where fink puts the > gtk libs. > Im not totally sure if you need to download a gtk dependent program > using either fink or apt-get but you might have too. I think I did gftp > before I even attempted any of this. In any case I think this should > work for most of you, if you are having trouble email me and I will try > and help you. The most important thing to do is try and use fink to > download and compile a GTK dependent app like gftp and if thats working > then do the gtk+ libs that I talked about and the compile instructions I > wrote up above, those things should pretty much guarantee that you can > compile your own gtk apps and run them with X11 > > John |
From: Charles L. <cl...@gh...> - 2005-03-10 18:37:12
|
John Bender said: > gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags > gtk+-2.0``pkg-config --libs gtk+-2.0` This should work under Fink. If not, you may want to try asking on one of the fink lists, since they handle GTK+-on-X11 issues all the time. (As Andy mentioned, gtk+osx aims to eliminate the need for X11 when running GTK+ on OS X, and the gtk+ packages distributed via Fink all require an X11 server to run.) > make sure you change it to this > > gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags > gtk+-2.0``pkg-config --libs gtk+-2.0` -I/sw/lib > > note the difference on the end is -I/sw/lib which is where fink puts > the gtk libs. I'm confused as to why this worked... Fink shouldn't have include files i= n /sw/lib. Not sure if this was a cut-n-paste error, but you probably want to put a space between the two backtick expressions (i.e. "` `", not "``"). --=20 Charles Lepple cl...@gh... |