LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-31-2007, 12:48 PM   #1
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
label at the end of compuound statement error


I'm trying to compile jogutils in my sony vaio but I'm getting an error "label at the end of compound statement" I tried deleting the "defaul:" statement from the .c files but when i do that it gets even worse. Can someone please help me to compile this utils? how do i get rid of that error? thx
 
Old 08-31-2007, 12:59 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Can you post the relevant piece of code? Usually you don't have to simply remove a statement, but replace an obsolete goto [LABEL] statement with a return statement and then remove the LABEL.
 
Old 08-31-2007, 01:20 PM   #3
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Original Poster
Rep: Reputation: 30
This is the output from make:

Quote:
roedor:/home/fabian/jogutils# make
cd jogapp; make
make[1]: Entering directory `/home/fabian/jogutils/jogapp'
gcc -g -O2 `gtk-config --cflags` -c jogapp.c
jogapp.c: In function ‘draw_picture’:
jogapp.c:184: error: label at end of compound statement
jogapp.c:223: error: label at end of compound statement
jogapp.c: In function ‘read_rc’:
jogapp.c:272: warning: incompatible implicit declaration of built-in function ‘exit’
jogapp.c: In function ‘check_jog’:
jogapp.c:319: warning: incompatible implicit declaration of built-in function ‘exit’
jogapp.c:367: error: label at end of compound statement
jogapp.c: In function ‘main’:
jogapp.c:463: warning: incompatible implicit declaration of built-in function ‘exit’
jogapp.c:476: warning: incompatible implicit declaration of built-in function ‘exit’
make[1]: *** [jogapp.o] Error 1
make[1]: Leaving directory `/home/fabian/jogutils/jogapp'
make: *** [jogapp/jogapp] Error 2

And this are lines 89 and 224 with the fn that causes the error, lines 184 and 223 ar
e in red:

Quote:
Quote:
void draw_picture(GdkDrawable *gd)
{
GdkPixmap *pixmap;
GdkPixmap *pixmap2;
GdkFont *font;
char str[100];

gdk_draw_rectangle( gd, drawing_area->style->black_gc,
TRUE, 0, 0, PICT_WIDTH, PICT_HEIGHT);

font = gdk_font_load( fontname );
set_color( 0x0000, 0x0000, 0xffff);

switch( mode ){
case NORM: /* normal mode */
set_color( 0x0000, 0x0000, 0xffff);
switch( delta ){
case 2: /* rotate down 1st step */
gdk_draw_string(gd, font, g_gc, -5, 15-5,
app_title[ring_num(app_num_buff-1)] );
gdk_draw_string(gd, font, g_gc, 10, 30-5,
app_title[app_num_buff] );
gdk_draw_string(gd, font, g_gc, 5, 45-5,
app_title[ring_num(app_num_buff+1)] );
gdk_draw_string(gd, font, g_gc, -10, 60-5,
app_title[ring_num(app_num_buff+2)] );
pixmap = gdk_pixmap_create_from_xpm(drawing_area->window, NULL, NULL,
"./img2.xpm");
delta = 1;
break;
case 1: /* rotate down 2nd step */
gdk_draw_string(gd, font, g_gc, -10, 15-10,
app_title[ring_num(app_num_buff-1)] );
gdk_draw_string(gd, font, g_gc, 5, 30-10,
app_title[app_num_buff] );
gdk_draw_string(gd, font, g_gc, 10, 45-10,
app_title[ring_num(app_num_buff+1)] );
gdk_draw_string(gd, font, g_gc, -5, 60-10,
app_title[ring_num(app_num_buff+2)] );
pixmap = gdk_pixmap_create_from_xpm(drawing_area->window, NULL, NULL,
"./img2.xpm");
delta = 100;
break;
case 100: /* no rotation but needs to be updated */
delta = 0; /* continue */
case 0: /* no rotation, no need to be updated */
gdk_draw_string(gd, font, g_gc, 0, 15,
app_title[ring_num(app_num-1)] );
set_color( 0x0000, 0xdfff, 0xdfff);
gdk_draw_string(gd, font, g_gc, 15, 30,
app_title[app_num] );
set_color( 0x0000, 0x0000, 0xffff);
gdk_draw_string(gd, font, g_gc, 0, 45,
app_title[ring_num(app_num+1)] );

pixmap = gdk_pixmap_create_from_xpm(drawing_area->window, NULL, NULL,
"./img1.xpm");
pixmap2 = gdk_pixmap_create_from_xpm(drawing_area->window, NULL, NULL,
"./img4.xpm");
if (pixmap2) {
gint w, h;
gdk_window_get_size(pixmap2, &w, &h);
gdk_draw_pixmap(gd, g_gc, pixmap2, 0, 0, PICT_WIDTH-35, 20, w, h);
gdk_pixmap_unref(pixmap2);
}

app_num_buff = app_num;
break;
case -2: /* rotate up 1st step */
gdk_draw_string(gd, font, g_gc, -10, 15-10,
app_title[ring_num(app_num-1)] );
gdk_draw_string(gd, font, g_gc, 5, 30-10,
app_title[app_num] );
gdk_draw_string(gd, font, g_gc, 10, 45-10,
app_title[ring_num(app_num+1)] );
gdk_draw_string(gd, font, g_gc, -5, 60-10,
app_title[ring_num(app_num+2)] );
pixmap = gdk_pixmap_create_from_xpm(drawing_area->window, NULL, NULL,
"./img3.xpm");
delta = -1;
break;
case -1: /* rotate up 2nd step */
gdk_draw_string(gd, font, g_gc, -5, 15-5,
app_title[ring_num(app_num-1)] );
gdk_draw_string(gd, font, g_gc, 10, 30-5,
app_title[app_num] );
gdk_draw_string(gd, font, g_gc, 5, 45-5,
app_title[ring_num(app_num+1)] );
gdk_draw_string(gd, font, g_gc, -10, 60-5,
app_title[ring_num(app_num+2)] );
pixmap = gdk_pixmap_create_from_xpm(drawing_area->window, NULL, NULL,
"./img3.xpm");
delta = 100;
break;
default:
}
if (pixmap) {
gint w, h;
gdk_window_get_size(pixmap, &w, &h);
gdk_draw_pixmap(gd, g_gc, pixmap, 0, 0, PICT_WIDTH-25, 0, w, h);
gdk_pixmap_unref(pixmap);
}
break;
case VOL: /* volume mode */
delta = 0;
set_color( 0x0000, 0xdfff, 0x0000);
gdk_draw_string(gd, font, g_gc, 0, 15,
"SET VOLUME" );
set_color( 0x0000, 0x0000, 0xffff);
gdk_draw_string(gd, font, g_gc, 15, 30,
"RETURN" );
// sprintf( str, "[%02d]", vol );
//gdk_draw_string(gd, font, g_gc, 0, 45,
// str );
set_color( 0xc000, 0xc000, 0xc000);
gdk_draw_rectangle( gd, g_gc,
TRUE, 0, 35, PICT_WIDTH-25, 14);
set_color( 0x0000, 0x0000, 0x0000);
gdk_draw_rectangle( gd, g_gc,
TRUE, 1, 36, PICT_WIDTH-27, 12);
set_color( 0x0000, 0xffff, 0x0000);
gdk_draw_rectangle( gd, g_gc,
TRUE, 1, 36, vol*(PICT_WIDTH-28)/MAX_VOL, 12);
pixmap2 = gdk_pixmap_create_from_xpm(drawing_area->window, NULL, NULL,
"./img4.xpm");
if (pixmap2) {
gint w, h;
gdk_window_get_size(pixmap2, &w, &h);
gdk_draw_pixmap(gd, g_gc, pixmap2, 0, 0, PICT_WIDTH-35, 20, w, h);
gdk_pixmap_unref(pixmap2);
}

break;
default:
}
}
 
Old 08-31-2007, 02:49 PM   #4
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Original Poster
Rep: Reputation: 30
this problem was fixed adding ; before the } or deleting the default statement, either one solve it. thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub error right at end simcox1 Linux From Scratch 7 02-16-2006 04:53 AM
kernel programming error...cannot see usb label Yerp Linux - Software 0 11-27-2005 05:17 PM
warning: deprecated use of label at end of compound statement abk4523 Programming 1 03-06-2005 09:50 AM
error when rebooting could'nt find matching filesystem: label=/home bigdawg9950 Linux - Newbie 2 08-30-2004 02:03 AM
no / at the end of address gives error doralsoral Linux - Software 3 05-27-2004 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration