Anjuta, Glade and C++
I am using Anjuta+Glade to create a GTK+ GUI.
However, I am having problems with C++ code. What is the best way to create a program using C++ and GTK+? Right now, what I am doing is that I create a "GTK 2.0 Project", say that I want to use "both C and C++" and then change the generated makefile by replacing CC=gcc by CC=g++. That way I can put C++ code in the callbacks.c file. It works, but I would prefer to do things correctly. Is there a way to tell Anjuta to generate the makefile with CC=g++? Or do I have to give up on the callbacks.c file when using GTK with C++? I also tried creating a "gtkmm 2.0 project". But in that case, there is no callbacks.c file. How do I proceed in this case? Do you know any good tutorial for creating a gtkmm project with Anjuta? I know about this one, but unfortunately it only deals with gtk projects having a callbacks.c file. |
Quote:
Quote:
- Don't mix C and C++. Use separate files (.c extension for C, .cxx for C++). - Remember you must add extern "C" to C function prototypes (in .h files) in order to call them from C++. Quote:
1. expend a little time with google 2. if 1 doesn't work, try to find IRC forums related to Anjuta, gtkmm or both 3. if 2 doesn't help, ask in some of the Anjuta or gtkmm mailing lists (look around in the project sites). Happy coding ;-) |
All times are GMT -5. The time now is 06:04 AM. |