maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Where to add "pkg-config --cflags gtk+-2.0" in madde? (https://talk.maemo.org/showthread.php?t=54828)

omeriko9 2010-06-01 19:22

Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
I'm trying to compile with madde a control panel plugin in c.

In the wiki it says:

Quote:

MADDE works well for GTK+ development (in C). At minimum the lines 'pkg-config --cflags gtk+-2.0' (for source to object file compiling) and 'pkg-config --libs gtk+-2.0' (for linking) is needed in your Makefile
.
.
.
How about Hildon development (in C)?

Like the above; just replace 'gtk+-2.0' with 'hildon-1 libosso'
Well, where in the makefile I should put these lines??...

And another question - does the current madde version (for win) uses PR1.2 libraries? (Meaning: using libglib-2.0.so.1 instead of libglib-2.0.so.0)

gri 2010-06-01 19:28

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
If you're using qmake, add the following the the .pro file:
Code:

CONFIG += link_pkgconfig
PKGCONFIG += gtk+-2.0

If you're using plain Makefiles, someone with knowledge of that should answer :)

Edit: Yes, all MADDE versions above 0.6.14 support PR 1.2.

Edit #2: When using QtCreator, please also take a look at this bug report: http://bugreports.qt.nokia.com/brows...s:all-tabpanel

Joorin 2010-06-01 19:44

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
In an "ordinary" Makefile, the following is common
Code:

CFLAGS += `pkg-config --cflags gtk+-2.0`
LDFLAGS += `pkg-config --libs gtk+-2.0`

Please note that backtick is used to make the shell expand the call to pkg-config.

omeriko9 2010-06-01 19:52

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
Quote:

Originally Posted by Joorin (Post 694506)
Please note that backtick is used to make the shell expand the call to pkg-config.

I know this is how it works in linux, but I'm running madde from windows - will the backtick have the same results?

omeriko9 2010-06-01 20:26

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
Definately I miss something. These are the qmake results:

Quote:

C:/MADDE/0.6.72/sysroots/fremantle-arm-sysroot-10.2010.19-1-slim/usr/lib/crt1.o:
In function `_start':
init.c:(.text+0x30): undefined reference to `main'
build/libcallnotify.o: In function `execute':
libcallnotify.c:(.text+0x28): undefined reference to `gtk_window_get_type'
libcallnotify.c:(.text+0x3c): undefined reference to `g_type_check_instance_cast
'
libcallnotify.c:(.text+0x70): undefined reference to `gtk_dialog_new_with_button
s'
libcallnotify.c:(.text+0x7c): undefined reference to `hildon_check_button_new'
libcallnotify.c:(.text+0x84): undefined reference to `gtk_button_get_type'
libcallnotify.c:(.text+0x94): undefined reference to `g_type_check_instance_cast
'
libcallnotify.c:(.text+0x9c): undefined reference to `gtk_button_set_label'
libcallnotify.c:(.text+0xa4): undefined reference to `hildon_check_button_new'
libcallnotify.c:(.text+0xb0): undefined reference to `g_type_check_instance_cast
'
libcallnotify.c:(.text+0xb8): undefined reference to `gtk_button_set_label'
libcallnotify.c:(.text+0xc0): undefined reference to `hildon_check_button_new'
libcallnotify.c:(.text+0xcc): undefined reference to `g_type_check_instance_cast
'
libcallnotify.c:(.text+0xd4): undefined reference to `gtk_button_set_label'
libcallnotify.c:(.text+0xdc): undefined reference to `gtk_label_new'
libcallnotify.c:(.text+0xf8): undefined reference to `gtk_hscale_new_with_range'

libcallnotify.c:(.text+0x1b0): undefined reference to `g_strtod'
libcallnotify.c:(.text+0x1bc): undefined reference to `gtk_range_get_type'
libcallnotify.c:(.text+0x1c8): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x1cc): undefined reference to `gtk_range_get_adjustment'

libcallnotify.c:(.text+0x1dc): undefined reference to `gtk_adjustment_set_value'

libcallnotify.c:(.text+0x1e8): undefined reference to `gtk_dialog_get_type'
libcallnotify.c:(.text+0x1f8): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x200): undefined reference to `gtk_container_get_type'
libcallnotify.c:(.text+0x210): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x218): undefined reference to `gtk_container_add'
libcallnotify.c:(.text+0x224): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x230): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x238): undefined reference to `gtk_container_add'
libcallnotify.c:(.text+0x244): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x250): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x258): undefined reference to `gtk_container_add'
libcallnotify.c:(.text+0x264): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x270): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x278): undefined reference to `gtk_container_add'
libcallnotify.c:(.text+0x284): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x290): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x298): undefined reference to `gtk_container_add'
libcallnotify.c:(.text+0x2a0): undefined reference to `gtk_widget_show_all'
libcallnotify.c:(.text+0x2ac): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x2b0): undefined reference to `gtk_dialog_run'
libcallnotify.c:(.text+0x2bc): undefined reference to `gtk_widget_get_type'
libcallnotify.c:(.text+0x2c8): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x2cc): undefined reference to `gtk_widget_destroy'
libcallnotify.c:(.text+0x2f4): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x2f8): undefined reference to `hildon_check_button_get_a
ctive'
libcallnotify.c:(.text+0x310): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x314): undefined reference to `hildon_check_button_get_a
ctive'
libcallnotify.c:(.text+0x32c): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x330): undefined reference to `hildon_check_button_get_a
ctive'
libcallnotify.c:(.text+0x344): undefined reference to `gtk_adjustment_get_value'

libcallnotify.c:(.text+0x378): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x380): undefined reference to `hildon_check_button_set_a
ctive'
libcallnotify.c:(.text+0x390): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x398): undefined reference to `hildon_check_button_set_a
ctive'
libcallnotify.c:(.text+0x3a8): undefined reference to `g_type_check_instance_cas
t'
libcallnotify.c:(.text+0x3b0): undefined reference to `hildon_check_button_set_a
ctive'
collect2: ld returned 1 exit status
make: *** [build/helloworld] Error 1
:( indeed...

gri 2010-06-01 20:32

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
Did you also add "PKGCONFIG += hildon-1" or whatever the commandline in the Makefile would be as you said in your first post?
Do you have a main function? (the first error)
What is your "TEMPLATE" when using qmake? lib, app?
Do you compile using QtCreator or the MADDE commandline? (Very important!)

You can also take a look at this example project of the bug report:
http://bugreports.qt.nokia.com/secur...estproject.zip

omeriko9 2010-06-01 21:11

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
Quote:

Originally Posted by gri (Post 694649)
Did you also add "PKGCONFIG += hildon-1" or whatever the commandline in the Makefile would be as you said in your first post?
Do you have a main function? (the first error)
What is your "TEMPLATE" when using qmake? lib, app?
Do you compile using QtCreator or the MADDE commandline? (Very important!)

You can also take a look at this example project of the bug report:
http://bugreports.qt.nokia.com/secur...estproject.zip

Thanks!!!

I used the "lib" template and it worked!
I'm not using QtCreator but copied a .c file from esbox in scratchbox because I can't compile there against PR1.2 libraries (esbox won't update for some reason...).

Venemo 2010-06-01 22:55

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
It was not working for me, either.

For me, adding the directories of the required libraries to my project file's include paths and then adding the libraries to the LIBS made it work with Qt Creator.

This is how I did it: here is my example project file

gri 2010-06-01 23:00

Re: Where to add "pkg-config --cflags gtk+-2.0" in madde?
 
Quote:

Originally Posted by Venemo (Post 694905)
It was not working for me, either.

For me, adding the directories of the required libraries to my project file's include paths and then adding the libraries to the LIBS made it work with Qt Creator.

This is how I did it: here is my example project file

Should be working in the QtCreator snapshot of tomorrow (or one day more).

Take a look at the bug report I mentioned in my first post:
http://bugreports.qt.nokia.com/brows...s:all-tabpanel

It has been fixed today:
Code:

Karsten Heimrich added a comment - 01/Jun/10 05:48 PM
Hi, I've fixed the problem in Creator trunk, still it does not work properly on windows because of a bug in MADDE. To make it work, just edit in your MADDE install dir (Path/To/Madde/madbin\pkg-config.cmd), replace the line with @env.exe PERL5LIB=/madlib/perl5 pkg-config %*



All times are GMT. The time now is 10:59.

vBulletin® Version 3.8.8