Configuring GTK+ 2.x in Netbeans

Well, hello after a long time. Blogging needs time and that is the thisng I do not seem to have much these days. 😦  I even can’t remember the last time i took a photo. really busy over making the unique file browser for Sahaj Linux.

As I am working in GTK+ 2 and the main lot of programmers (except me) sees Netbeans as their wordprocessor (!) … A friend and fellow programmer insistemd me to try Netbeans once.  Thus I begun.

Well, if you don’t have the entire package of Netbeans, you will have to download the C/C++ Development Pack. After this, the netbeans will be able to detect and debug general C/C++ code. However, one have to configure Netbeans to include support for external libraries like GTK. Her’s how to do it:

Open a project in netbeans. right click onto it and get into Properties. In the Build menu (probably the 2nd menu in the tree), click “C compilers”.

Here you’ll see the option “Include Directories under “General” Tab. Click on browse (at left a small button) and include all the dependecy for gtk like cairo, gtk, glib, pango, atk, libpng, libjpg, etc.. detailed picture given below !

Screenshot for including necessary libs for gtk+ 2

Now again We have to configure the Linker of Netbeans. We go to Linker > Libraries > Add Library. Here you’ll have to choose the libgtk xxxx.so file from “/usr/lib/” .. so go in the folder /usr/lib. Now select the File type to  “.so” (dynamic library) from the default “.a” (static library). unless this you’ll not find libgtk.so ! Again the following picture explains all this!
Linker configuration for GTK+2 in Netbeans

Now you are done. Enjoy writing GTK code with Netbeans.

P.S: Though I was referred to write code on Netbeans, I am back to GEdit again! I’ll let you know How and Why in the next post where i’ll show you how to make GEdit a really cool code editor.

Adios!

Advertisements

4 thoughts on “Configuring GTK+ 2.x in Netbeans

  1. I like the Bluefish editor. Its nice too ! Netbeans is the best editor but its shortcomings are there too.

    1. Too much resource hungry. Just hogs down the memory
    2. Too many windows all around distracts the user from writing clean codes.
    3. Lot of redundant files and crap autogenerated codes.

  2. Well. You know what? This is JUST the exact thing I needed and was hunting for ages! Thanks! 🙂 By the way, talking of IDEs, well. Matter of choice. But the BEST source code editor out there today is undisputedly Notepad++! You all gotta try it. I am a blogger as well! I recently made a small app for beginners of Java GUI here:- http://jcalc.plz.re. I am a programmer, developer etc. My blogs:-

    http://www.hack-a-shack.cc.cc – My own blog.
    http://www.cyber-rockerz.cc.cc – I team blog here with a friend. 🙂 Must check out!

  3. Thanks A LOT for the tutorial !!! I was getting mad trying to figure out myself and on the net the solution for running GTK+ on netbeans. Just linked the right include folders and lib .so file and the program was built, compiled and ran. Thanks again !!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s