User forums > Using Code::Blocks
Problem compiling GTK with Linux
(1/1)
elwario91:
Hello,
I'm using Linux Ubuntu Edgy
I tried compiling a GTK source file but first he didn't found the header,
I added the directories in the compiler options -> directories
Now he seems to find it and compile a bit better but but :(
I have this output :
--- Code: ---/home/warren/Projects/eeee/main.cpp:10: référence indéfinie vers « gtk_init »
/home/warren/Projects/eeee/main.cpp:13: référence indéfinie vers « gtk_window_new »
/home/warren/Projects/eeee/main.cpp:14: référence indéfinie vers « g_type_check_instance_cast »
/home/warren/Projects/eeee/main.cpp:14: référence indéfinie vers « gtk_main_quit »
/home/warren/Projects/eeee/main.cpp:14: référence indéfinie vers « g_signal_connect_data »
/home/warren/Projects/eeee/main.cpp:17: référence indéfinie vers « gtk_widget_show »
/home/warren/Projects/eeee/main.cpp:18: référence indéfinie vers « gtk_main »
/home/warren/Projects/eeee/main.cpp:21: référence indéfinie vers « gtk_exit »
:: === Build finished: 8 errors, 0 warnings ===
--- End code ---
Please help me, I'm ecomong crazy!!
Thanks
momaa:
You have installed "libgtk2.0-dev" package in Ubuntu. Apt-get it or use Synaptic Package Manager.
Then use pkg-config to find out both --cflags and --libs path for gtk+-2.0. Like this:
$ pkg-config --cflags gtk+-2.0
and
$ pkg-config --libs gtk+-2.0
---
Download this example of GTK+ 2.0 project: http://www.futuredesktop.org/tmp/test3.tar.gz
( note: if you must unzip it manually, do: tar -xvzf test3.tar.gz )
Open the project in Code::Blocks and study the settings in Project -> Build options.
* Compiler -- Other options.
and
* Linker -- Other linker options.
-----------
This quide will tell you more.
http://www.gtk.org/tutorial/x111.html
:D
momaa:
Sorry.
I sent you a bad code. The project options in the tar-gz ball (test3.tar.gz) are not set right. Wait a minute till I upload an updated copy.
EDIT: OK. It's up2date now.
Navigation
[0] Message Index
Go to full version