Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm currently writing a program that uses the GTK library.

The programs compile and run fine.

The problem is - geany seems to not 'know' what structs and methods are in the GTK header file.

It won't highlight structs, and doesn't offer to autocomplete functions.

I've done some experimenting - if I'm #including my own header files - it will only do the autocomplete if that file is open in geany. Though it is ok for other std header files, like stdlib.h and math.h

What do I do to fix this?

share|improve this question

1 Answer 1

i've encountered this same problem today..

geany must know where to look to get a valid list of symbols and so it read the sources of all the opened files, so if you want a useful symbol list you should open all the header files you need before start programming..

even if geany want to look automagically in the header files you include it will not be able to guess which gtk version you want use for your project (gtk2, gtk3, ...)..

remember that geany is lightweigth :-)

but here is my workaround.. (i guess you are on linux and you have a shell, gcc, etc)

to get the job done i did this :

echo "#include <gtk/gtk.h>" > gtk_headers.c
gcc -E gtk_headers.c `pkg-config gtk+-3.0 --cflags --libs` -o gtk_headers.h

(i'm working with gtk version 3, adjust the pkg-config line to meet your needs)

then i open my project files and gtk_headers.h, this way geany can rip the headers of the gtk library i'm working on..

pro : simple

cons : the headers i open in geany is ~1.6 MB O_o

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.