GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Mon Dec 22, 2014 11:22 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Newbie needs help - GTK+ examples in the reference manual
PostPosted: Tue Aug 19, 2014 4:56 pm 
Offline

Joined: Mon Aug 18, 2014 7:16 pm
Posts: 3
I'm almost a complete newbie with linux and GTK and I'm working my way through the online reference manual (https://developer.gnome.org/gtk3/stable/ch01s05.html). I had no problems with the simple examples but as soon as I started through the more complex ones, I'm lost because I can't build them.

The version 3, "application 1" example has 5 source files: main.c, exampleapp.c & .h, and exampleappwin.c &.h. There's a makefile.am and a zipped makefile.in. I can't figure out how to generate/extract a makefile from what's there and I can't "manually" (command line) figure out how to build this thing.

I'm working with the latest versions of Ubuntu and GTK.

....Help?....


Top
 Profile  
 
 Post subject: Re: Newbie needs help - GTK+ examples in the reference manua
PostPosted: Tue Aug 19, 2014 9:24 pm 
Offline
GTK+ Geek

Joined: Sat Jul 26, 2014 11:43 pm
Posts: 69
Do you have automake for the makefile.am? Have you used make with a makefile to compile your code before?

http://www.gnu.org/software/automake/ma ... omake.html

You can use apt-get on Ubuntu to get make and automake if you don't have them. The example that you are working on is a little more than "trivial" but the makefile should build everything for you easily.


Top
 Profile  
 
 Post subject: Re: Newbie needs help - GTK+ examples in the reference manua
PostPosted: Wed Aug 20, 2014 2:11 pm 
Offline

Joined: Mon Aug 18, 2014 7:16 pm
Posts: 3
What's tripping me up is that the GTK examples don't seem to have a configure.ac file. Like I said, there is a Makefile.am and a zipped Makefile.in but I can't find a configure.ac file which is preventing me from running autotools.


Top
 Profile  
 
 Post subject: Re: Newbie needs help - GTK+ examples in the reference manua
PostPosted: Wed Aug 20, 2014 10:58 pm 
Offline
GTK+ Geek

Joined: Sat Jul 26, 2014 11:43 pm
Posts: 69
You can compile the files for the examples depending on your source files with gcc. I don't think that you need a makefile. For example1 you can try something like this

gcc -Wall `pkg-config --cflags gtk+-3.0` main.c exampleapp.c exampleappwin.c -o example1 `pkg-config --libs gtk+-3.0`

Some of those trivial examples are pretty tough. Once you get into the xml and ui scripts you might have to make path changes to get them to work.


Top
 Profile  
 
 Post subject: Re: Newbie needs help - GTK+ examples in the reference manua
PostPosted: Thu Aug 21, 2014 3:26 pm 
Offline

Joined: Mon Aug 18, 2014 7:16 pm
Posts: 3
That did it. Thanks - I can finally build the examples!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group