LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gtk_init_check() call fails and return -1 (https://www.linuxquestions.org/questions/programming-9/gtk_init_check-call-fails-and-return-1-a-677805/)

deedhnd 10-20-2008 09:02 AM

gtk_init_check() call fails and return -1
 
I am doing

if(!gtk_init_check(NULL,NULL)
fprintf("gtk not initialised properly");

Can you pls help me why the call is failing on SLES 10 ia64?

I have installed

gtk
gtk2
gtk-devel
gtk2-devel

What's the reason it is failing?
Can we somehow know what's the reason behind it ?

Thnx in advance

darell 10-20-2008 12:20 PM

hi,
Code:

if(!gtk_init_check(NULL,NULL))
      printf("gtk not initialised properly");

..."!" means in your case zero(succes)

this should be better;)
Code:

if(gtk_init_check(NULL,NULL))
      printf("gtk not initialised properly");

"!" means false, and false is only 0.
1, 2, 3 ....-1, -2 means true.

deedhnd 10-21-2008 06:10 AM

if you see the return value of gtk_init_check() when it fails to initialise properly...its false...

so my code is correct only...

any help why gtk_init_check(NULL,NULL) is failing?
Am I passing the wrong arguments??

keefaz 10-21-2008 08:09 AM

Maybe try replace temporarly if(!gtk_init_check(NULL,NULL))
with if(!gtk_init(NULL,NULL))

gtk_init() is verbose I believe, so you may have a chance to see where it does not work


All times are GMT -5. The time now is 04:11 AM.