Re: how to include gtk header file in gtk.



jayarajuc wrote:
when compilingthe program with the following statement
 gcc base.c -o base 'pkg-config --cflags --libs gtk+-2.0'

i am getting an error

Your single quotes should be back ticks.

ie:

$ gcc test.c -o test `pkg-config --cflags --libs gtk+-2.0`

The backtick (`) character is the same key as the tilda key. (Assuming you're sitting in front of an english keyboard. Which I kind of doubt seeing that your email address looks like its from India.)

Anyhow, hope that helps.

Oh, and as a second thought, if the error your getting is this:
test.cc:1:33: error: non_existant_header.h: No such file or directory

Something is whack with your gtk installation.

Unless of course you also get this error message:

Package non_existant_package was not found in the pkg-config search path.
Perhaps you should add the directory containing `non_existant_package.pc'
to the PKG_CONFIG_PATH environment variable
No package 'non_existant_package' found

In which case, you probably just don't have gtk installed at all. Which means you should probably install the library before you try and use it in development. (Note: Having the binary libraries installed isn't enough. You need the development headers and the such. On ubuntu, something like:

$ sudo apt-get install libgtk+-2.0-dev

Should get everything you need installed. )

Cheers,
Paul



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]