LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-07-2006, 10:24 PM   #1
intramaweb
LQ Newbie
 
Registered: May 2006
Location: Coventry, UK
Distribution: CentOS 5
Posts: 15

Rep: Reputation: 0
Glib compile error


I'm tring to install glib 1.2.10 but when I try and compile the source, I get the following error:

Code:
gcc -DHAVE_CONFIG_H -I. -I. -I. -DG_LOG_DOMAIN=g_log_domain_glib -g -O2 -Wall -D_REENTRANT -c gstrfuncs.c  -fPIC -DPIC -o .libs/gstrfuncs.lo
gstrfuncs.c: In function `g_printf_string_upper_bound':
gstrfuncs.c:870: error: syntax error before string constant
gstrfuncs.c:1037: error: syntax error before string constant
gstrfuncs.c:1080: error: syntax error before string constant
gstrfuncs.c:1111: error: syntax error before string constant
make[2]: *** [gstrfuncs.lo] Error 1
make[2]: Leaving directory `/home/user/Desktop/glib-1.2.10'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/Desktop/glib-1.2.10'
make: *** [all-recursive-am] Error 2
Looking inside gstrfuncs.c, the lines reporting errors are all the same:

Code:
g_warning (G_GNUC_PRETTY_FUNCTION
The code above is all there is on each line so I don't understand how there can be a syntax error. Different things are passed to the function in each function call but not on the same line. (The function call ends on the line below with the closed bracket in its proper place.)

It's been a while since I went to C lessons and I think I only got up to the if statement so perhaps unsurprisingly my debugging attempts haven't resulted in much success. I'm stumped so any bright ideas will be very welcome!

Last edited by intramaweb; 10-07-2006 at 10:27 PM.
 
Old 10-08-2006, 10:24 PM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
Why are you attempting to do this???? You have no real reason to........

From: http://isoredirect.centos.org/centos...6/RedHat/RPMS/

Code:
glib-1.2.10-11.1.i386.rpm                              15-Mar-2004 22:45  128K
glib-devel-1.2.10-11.1.i386.rpm                        15-Mar-2004 22:45  111K
 
Old 10-08-2006, 10:59 PM   #3
caspervn
Member
 
Registered: Jul 2005
Location: Vietnam
Distribution: Fedora Core 2
Posts: 55

Rep: Reputation: 15
intramaweb: what's your gcc version ?
Did you try older gcc ? May be gcc-2.95.3 is good (at least)
 
Old 01-16-2007, 11:16 PM   #4
limeric22
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu 6.06, Debian etch, RHEL4
Posts: 1

Rep: Reputation: 0
Solution if needed still

intramaweb,

I'm new to this forum and Linux for that matter. I thought I'd give some help since I have figured it out. Locate all instances of this line of code in the file gstrfuncs.c:
Code:
g_warning (G_GNUC_PRETTY_FUNCTION
There should be four according to your error:
870, 1037, 1080, 1111

Add a comma at the end of the line. So it should read:
Code:
g_warning (G_GNUC_PRETTY_FUNCTION,
This worked for me. I think there is a patch out there but why bother if you only have to add four commas.

You may have to "make distclean" before you try "./configure && make" again.

Hope this helps.
- limeric22

Last edited by limeric22; 01-16-2007 at 11:20 PM.
 
Old 01-17-2007, 12:57 AM   #5
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
i think this old gcc3 patch will fix it
download this to outside the build directory
http://www.linuxfromscratch.org/patc...-gcc34-1.patch
patch with the command
patch -Np1 -i ../glib-1.2.10-gcc34-1.patch

i think i would seriously pass on the adding a comma thing.
i think this is suposed to be fixed with line
#define G_GNUC_PRETTY_FUNCTION
 
Old 04-19-2007, 09:08 PM   #6
bpringlemeir
LQ Newbie
 
Registered: Apr 2007
Posts: 6

Rep: Reputation: 0
The supplied patch is ok, but...

The supplied patch is ok, but the correct way would be like this,

- g_warning (G_GNUC_PRETTY_FUNCTION
- "(): unable to handle positional parameters (%%n$)");
+ g_warning ("%s(): unable to handle positional parameters (%%n$)", G_GNUC_PRETTY_FUNCTION);

Gcc version 3.3 and later changed the way "PRETTY_FUNCTION" behaves. Previously it was a string literal. Now it is a (const char *?) variable, so "string concatenation" doesn't work. This patch would work with any GCC and will display the function name on an error.
 
Old 09-28-2007, 04:37 PM   #7
stees
Member
 
Registered: May 2006
Distribution: OpenSuse 11, Red Hat, Fedora
Posts: 34

Rep: Reputation: 15
thanks guys that patch worked perfect, i had originally found another place where someone explain the mess in the code and manually edited the function calls before, but i was rebuilding the package and didnt back it up so the patch saved me some time.
 
Old 04-23-2008, 09:12 AM   #8
kewei
LQ Newbie
 
Registered: Dec 2006
Posts: 4

Rep: Reputation: 0
hanks guys that patch worked perfect
 
  


Reply

Tags
compile, error, failure, glib, install, make


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Glib cross compile error m.harshavardhan Linux - General 1 12-04-2007 04:31 AM
what is glib and why does MC need it to compile zbenjudah Linux - Newbie 4 05-08-2006 02:24 AM
xmms install (needs glib>1.22), just installed glib 2.4.8 and still get error message eskiled Linux - Software 2 12-19-2005 10:12 PM
GTK+ compile error : glib-mkenums Sjaaksken Suse/Novell 6 12-11-2005 04:16 PM
glib-2.4.0 compile error trollman Linux - Software 2 04-09-2004 10:37 AM


All times are GMT -5. The time now is 12:31 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration