Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting started with GTK & Anjuta

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Linux GTK
Linux GTK  
Author Message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sat Sep 15, 2007 12:16 am    Post subject: Getting started with GTK & Anjuta Reply with quote

Here we go! GTK books I ordered on Amazon came today so I had to do something.

I have Ubuntu installed for a few weeks now and I was browsing Linux forums searching for
recommendations of a decent IDE I could install on it. I think I'll go with Anjuta as it seems
like a natural choice for many others doing Gnome/GTK development on Linux.

I decided to use Synaptic as GUI version of 'apt-get' and with a little help from the Official
Ubuntu Book
installing GTK+ development libraries turned out to be a rather easy task.

So far I don't have much experience with Linux, but from the articles on various forums
I think I see a problem with experienced guys and their advices. Whatever you ask they
start answering with "sudo ..."

As Ubuntu changes constant need for someone to use terminal for all kinds of advanced
activities, a lot of guidelines on the internet is probably "obsolete" by now. Anyway, here
I start installing GTK+ development library and everything else from Synaptic.

If I succeed, this can become some kind of tutorial written by a novice for other noobs. If
not, I'll just remove this post and start from scratch.





Step 1. At first, I was lost in so many offered packages, most of them with cryptic names, but then I noticed this 'Search'
button in the toolbar. Search dialog appeared and there I typed "libgtk".





Step 2. A shorter list appeared and there I selected "libgtk2.0-dev".





Step 3. Synaptic was smart enough to offer me additional packages and I said yes by clicking on 'Mark' button.





Step 4. In the toolbar, button 'Apply' became enabled. I clicked on it and dialog appeared where I confirmed I want to continue.





Step 5. After a while it was all set and done without any problem.





Step 6. Well, at this point I decided I need some 'Hello world' project to test my GTK installation. I used this one from
Ubuntuforums and after I managed somehow to copy/paste it from FireFox into my editor I launched the terminal and
it compiled and run just fine. Wow!

Just did my first GTK application.

PS: proba == test in croatian, so probagtk.c == testgtk.c

PPS: ubuntuforums.org - GTK+ Hello world

"compile with: gcc <filename> `pkg-config --cflags --libs gtk+-2.0`"

.


Last edited by delovski on Tue Sep 25, 2007 5:45 pm; edited 9 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Mon Sep 17, 2007 1:07 am    Post subject: Reply with quote

uf - Application Development in Ubuntu

"Here's a few nice flags to pass to gcc when compiling C:

-Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast \
-Wcast-qual -Wcast-align -Wwrite-strings -Wconversion \
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
-Wpadded -Wredundant-decls -Wunreachable-code -Wformat-nonliteral \
-Wnested-externs -g -pedantic -ansi -O2"
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Tue Sep 18, 2007 10:02 pm    Post subject: Reply with quote

Today I had another free evening so I could continue with my Linux apprenticeship and install Anjuta IDE.

As with GTK+ library, I decided to use Synaptic: System->Administration->Synaptic Pakage Manager.




Step 1. Again I started with the 'Search' button in the toolbar. Search dialog appeard and there I typed "anjuta".





Step 2. It found "anjuta" and "anjuta-common". Hm. Now what? Luckily, I have my virtual machine's disk image
backed up, so whatever I choose it won't make irrepairable demage. I picked the first thing from the list. It looked
as a right thing to do anyway.





Step 3. Ha! Seems like "anjuta" requires "anjuta-common" with it. Synaptic offered them both for installation
with some other package. Google gave me the explanation: libpcre3 is Perl 5 Compatible Regular Expression
Library.





Step 4. In the toolbar, button 'Apply' became enabled.





Step 5. I clicked on 'Apply' button and the dialog appeared asking me to confirm installation of 3 packages.





Step 6. Success! In less than two minutes Synaptic downloaded and installed required packages.





Step 7. Cool. I have Anjuta now.


Last edited by delovski on Wed Sep 19, 2007 10:41 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Tue Sep 18, 2007 10:38 pm    Post subject: Reply with quote

These two links seem handy:

anjuta.org - Anjuta IDE Manual

"Anjuta is a versatile Integrated Development Environment (IDE) for C and
C++ on GNU/Linux. It has been written for GTK/GNOME and features a number
of advanced programming facilities.

These include project management, application wizards, an on-board interactive
debugger, and a powerful source editor with source browsing and syntax
highlighting."

...

Anjuta 2.x Dependencies

"You must have these to install Anjuta 2.x. In case, you are installing binary
package, please also install corresponding devel package as well."


Last edited by delovski on Tue Sep 25, 2007 5:51 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Thu Sep 20, 2007 8:22 pm    Post subject: Reply with quote

Seems like I should install more libraries before I can start using Anjuta, but
I couldn't find a list of all required extra installations. Well, there is one at
Anjuta Download page, but people on ubuntuforums mention few other
packages
.

I compiled my own list of recommended or required additional libraries and
tools but it is quite possible there are more items I missed.

1) libgdl-1-dev,
Provides a support library for development tools from the GNOME environment.
Including symbol browser, dock and editor components.

2) gnome-devel,
These are the development tools of the GNOME Desktop environment, a
graphical interface to use on your Debian system. Included is everything
you need to create applications for GNOME, including IDE programs, user
interface creators and a tool to ease the translation of applications to other
languages.

3) libgnome-dev,
This package contains the include files and static library for the base GNOME
library functions.

4) libgnome32,
This package contains the shared library for the base GNOME library functions.

5) libopts25,
This package contains the shared libraries needed by binaries that use auto-
opts for option processing. The package containing the header files and static
libraries is libopts25-dev. The package containing the development tools is
autogen.

6) libopts25-dev,
This package contains the header files and static libraries used by autoopts.
The package containing the shared libraries is libopts25. The package containing
the development tools is autogen.

7) guile-1.6,
Guile is a Scheme implementation designed for real world programming,
providing a rich Unix interface, a module system, an interpreter, and many
extension languages. Guile can be used as a standard #! style interpreter,
via #!/usr/bin/guile, or as an extension language for other applications via
libguile.

8) autogen,
AutoGen is a tool designed for generating program files that contain repetitive
text with varied substitutions. This is especially valuable if there are several
blocks of such text that must be kept synchronized.
Included with AutoGen is a tool that virtually eliminates the hassle of pro-
cessing options, keeping usage text up to date and so on. This tool allows
you to specify several program attributes, innumerable options and option
attributes, then it produces all the code necessary to parse and handle the
command line and initialization file options.

9) autoconf,
The standard for FSF source packages. This is only useful if you write your
own programs or if you extensively modify other people's programs.
For an extensive library of additional Autoconf macros, install the `autoconf-
archive' package. For a book that explains how to use Autoconf, Automake,
and Libtool in conjunction, install the `autobook' package.

10) devhelp,
Devhelp's primary goal is to be an API documentation browser for GNOME.
It is able to scan for .devhelp files generated automatically for packages
that use gtk-doc-tools to generate documentation for libraries and programs.

11) glade,
Glade is a RAD tool to enable quick and easy development of user interfaces
for the GTK+ 2 toolkit. It also contains built-in support for generating the C
source code needed to recreate the interfaces.
If you want Glade with support for the GNOME libraries, you should install
the glade-gnome package.

12) subversion,
Subversion, also known as svn, is a version control system much like the
Concurrent Versions System (CVS). Version control systems allow many
individuals (who may be distributed geographically) to collaborate on a set
of files (typically source code). Subversion has all the major features of CVS,
plus certain new features that CVS users often wish they had.
This package includes the Subversion client (svn), tools to create a Subversion
repository (svnadmin) and to make a repository available over a network
(svnserve).


Last edited by delovski on Tue Sep 25, 2007 5:57 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Mon Sep 24, 2007 8:32 pm    Post subject: Reply with quote

Let's plug & pray!

Again I started Synaptic and decided to install everything from my grocery list all at once. Time will tell
if this was stupid or smart idea. Let's just hope for the best!




Step 1. For every item on my list I used the search dialog and I started with "libgdl-1-dev".





Step 2. Next item: "gnome-devel". This package brought 72 other items with it. Amazing!





Step 3. Next, "libgnome-dev" and next "libopts25" and "libopts25-dev"...





Step 4. ... and "guile-1.6" and "autogen". Now I have 104 packages to install.





Step 5. Then I continued with "glade" ...





Step 6. ... and finally "subversion". Other items from my list were already included with packages listed above.





Step 7. At this point I was sure that something went terribly wrong. Zero bytes to download!? Clicking
at those triangles hasn't revealed anything.





Step 8. Possible explanation: "libpq5" is missing! Googling told me this library has something
to do with PostgreSQL database and I don't need that, so I decided to proceed full speed ahead.





Step 9. Now you're talking. I clicked on "Apply" and after a while Synaptic downloaded and
installed required packages without more complaints. Who knows? Maybe all is fine now...





Step 10. Well, something happened here. There was only Anjuta in this menu before. Just to check
if the latest session with Synaptic hasn't broken my gtk+ development installation, I repeated that
earlier "Hello world" test in the Terminal and it compiled and run just fine.

Now I should do it from Anjuta!


Last edited by delovski on Tue Sep 25, 2007 6:05 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Tue Sep 25, 2007 12:06 am    Post subject: Reply with quote

Like I said, now I should do it from Anjuta! Surprised





Step 1. I started Anjuta and dialog appeared and I clicked on the first button. This should create
me a new project.





Step 2. Application Wizard starts. Next!





Step 3. Next, GTK project seems about right. Not that I actually understand the difference
between that and a Gnome project...





Step 4. Basic information... Finally something for my level of expertise!





Step 5. Hm! I'm not a poet!





Step 6. Another point where I'm not quite sure what I'm doing. I disabled those two check boxes.
I have no idea what is gettext and at least I'm sure my "Hello World" does not need Glade.





Step 7. Summary... well, I suppose that's it.





Step 8. At this point Anjuta started creating my project and after a while I stopped breathing.
Just a few more seconds and my heart would stop pounding, but fortunately Anjuta showed
the line that saved me: "Completed ... successful." Cool! But what's this "Now type 'make' to
compile" supposed to tell me?





Step 9. Now, let's look at main.c. It appears to be a simple console type of "Hello World." Who needs that?





Step 10. I replaced that "Hello World" with my old "Hello GTK+ World" I checked in terminal just
few days ago. Let's see what happens now.





Step 11. OMG! OMG! "Completed ... successful." Build was successful, although I need to confess
that first I tried 'Compile' command and it failed missearbly with maybe 5 billion errors & warnings.
Hm, is that why they told me to compile with make? Well, later I learned that I can use 'Compile'
command if I use the same params I've send to compiler in terminal.





Step 12. Mission acomplished! This completes my first programming task on Linux.

Hurrah!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Linux GTK All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group