Author Topic: undefined reference to `g_signal_connect'  (Read 25974 times)

Philippe RIO

  • Guest
undefined reference to `g_signal_connect'
« on: May 04, 2008, 12:11:55 AM »
================ SOURCE FILE ================================

%define  C_CALL         ; for C call convention
   %include 'lmadcros.inc'      ; use these madcros
   %include 'gAE.inc'



;------------------------- Code Section ---

SECTION .text

PROC         main,argc,argv


;   ************************************
;   *** Sauver la ligne de commandes ***
;   ************************************


         lea   eax,[.argc]

lea   ebx,[.argv]



invoke   gtk_init,eax,ebx


;   *******************************************
;   *** Initialiser le profile du programme ***
;   *******************************************

;   ============================================================================
;   ===> Le fichier profile doit se trouver dans le répertoire du programme <===
;   ============================================================================

call   PgmProfile_Init

;   ===================================================================
;   ===> Dans tous les cas possibles un profile a été mis en place <===
;   ===================================================================


         invoke   gtk_window_new,GTK_WINDOW_TOPLEVEL
         mov   edx,DWORD lpCurrentProject
         add   edx,RAD_PROJECT_WINDOW_HANDLE

mov   DWORD [edx],eax                     ; Save Window Handle
         push   eax                        ; Set Window handle onto the stack

invoke   g_signal_connect,DWORD [edx],szEvent_Destroy,PgmQuit,lpCurrentProject   ; Set Current Project Pointer as user data
         call   gtk_widget_show                     ; Window handle already on stack


;   Let's Gnome go on
;   =================


         call   gtk_main



ret

ENDP

; -------------------------------------
; Event Handlers ----------------------
; -------------------------------------

;   *************************
;   *** Exit from program ***
;   *************************

PROC         PgmQuit,widget,event
         invoke gtk_main_quit
         ret
ENDP

==================== MAKE FILE ==================

[Grincheux@Grincheux ~]$ cd Documents/gAE
[Grincheux@Grincheux gAE]$ nasm -v
NASM version 2.02-20080413 compiled on Apr 13 2008
[Grincheux@Grincheux gAE]$ make
gcc -Wall -O3  gAE.o -g -o gAE \
        `pkg-config --cflags glib-2.0` \
        `pkg-config --cflags gobject-2.0` \
        `pkg-config --cflags gtk+-2.0` \
        `pkg-config --cflags gnome gnomeui` \
        `pkg-config --cflags libglade-2.0` \
        `pkg-config --libs glib-2.0` \
        `pkg-config --libs gobject-2.0` \
        `pkg-config --libs gtk+-2.0` \
        `pkg-config --libs gnome gnomeui` \
        `pkg-config --libs libglade-2.0` \
        -I/usr/lib \
        -I/usr/include
gAE.o:gAE.asm:39: undefined reference to `g_signal_connect'
collect2: ld a retourné 1 code d'état d'exécution
make: *** [gAE] Erreur 1
[Grincheux@Grincheux gAE]$

=================== EOF =====================

I don't understand why I 'g_signal_connect' appears undefined !
Can someone help me ?

Thanks

nobody

  • Guest
Re: undefined reference to `g_signal_connect'
« Reply #1 on: May 04, 2008, 08:43:29 AM »
Is it supposed to be called "gtk_signal_connect"?

Just a wild-asmed guess, but that seems to be the way everything else is named... If that isn't it, "good luck" finding where it's supposed to be in that tangle of libraries gtk+ depends on!

Best,
Frank

Philippe RIO

  • Guest
Re: undefined reference to `g_signal_connect'
« Reply #2 on: May 04, 2008, 10:02:14 AM »
"gtk_signal_connect" is DEPRECATED, so I replace the call with g_signal_connect.
Is there an order when specifying libraries to link ?
I am new on linux and that kind of problem makes me loose a lot of time for something which is not a big problem... normally. I am new to NASM too... That make many problems to solve at the same time.
I have searched on many web sites for the same problem and found many answers very different between them and they do not help me. The same problem with a lot of answers that's not very clear ?

I have defined g_signal_connect as an extern function

;   ===> EXTERNALS FUNCTIONS <===
;   =============================

extern gtk_init

extern gtk_window_new

extern gtk_widget_show

extern gtk_main
extern gtk_main_quit
extern gtk_message_dialog_new
extern gtk_dialog_run
extern gtk_widget_destroy
extern gtk_signal_connect

and the problem is the save as with g_signal_connect.

have a good day... Today it's sunny if France but in my mind it is stormy.

Offline Airr

  • New Member
  • Posts: 1
Re: undefined reference to `g_signal_connect'
« Reply #3 on: July 23, 2010, 02:49:46 AM »
I know this is an old topic, but I thought I'd point out that g_signal_connect is a C macro.

Use g_signal_connect_data instead....

A.