Anyone using gtkmm ( http://www.gtkmm.org/ ) with code::blocks?
I downloaded a Developer (Full) Environment package here-> http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ ...the first one.
But how i integrate it with CB. I added gtkmm lib and include directories to my project but it won't compile. Obviously i missed some drectories :).
Code i am trying to compile:
#include <gtkmm.h>
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}
Error:
Project : Console application
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Priit\Desktop\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-g++.exe -I..\..\..\Dev\gtkmm\include -IC:\Dev\MinGW\include -c main.cpp -o .objs\main.obj
main.cpp:1:19: gtkmm.h: No such file or directory
main.cpp: In function `int main(int, char**)':
main.cpp:5: error: `Gtk' has not been declared
main.cpp:5: error: `Main' undeclared (first use this function)
main.cpp:5: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:5: error: expected `;' before "kit"
main.cpp:7: error: `Gtk' has not been declared
main.cpp:7: error: `Window' undeclared (first use this function)
main.cpp:7: error: expected `;' before "window"
main.cpp:9: error: `Gtk' has not been declared
main.cpp:9: error: `window' undeclared (first use this function)
main.cpp:9: error: `run' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 0 seconds)
11 errors, 0 warnings
Does anyone has cb template for gtkmm? :mrgreen:
OK, here's a walkthrough. If you want to create a template and sumbit it then that would be great.
- Download the gtkmm on win32 Developer (Full) Environment at the link you gave
http://www.pcpm.ucl.ac.be/~gustin/win32_ports/gtkmm.html
This package is all that's needed to get started writing GTK+ apps on win32 in C++. The installer will download the necessary gtk+ development stuff. I installed both to the default paths (c:\GTK)
- Note that GTK+ on win32 informs that the flag
"-mms-bitfields"
should be passed as a compiler option.
see: http://www.gimp.org/win32/
- Create a new Win32 GUI Application (for now since there is no template) and choose "Do not create any files"
- Activate the project, create a new file, cut and paste the code you were trying to compile:
#include <gtkmm.h>
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}
and save as test.cpp
- goto project->build options and then add the stuff seen in the following screen shots :D
Note that I used relative paths, so yours may differ somewhat, depending on where you created the project. After everything is as shown in the screens below, hit OK, and then compile (build). You should be able to click the run button and see a working
app.
(http://www.geocities.com/grv575/g1.jpg)
(http://www.geocities.com/grv575/g2.jpg)
(http://www.geocities.com/grv575/g3.jpg)
(http://www.geocities.com/grv575/g4.jpg)
(http://www.geocities.com/grv575/g5.jpg)