Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 10-07-2006, 09:24 PM   #1
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:

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:

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 09:27 PM.
Old 10-08-2006, 09:24 PM   #2
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: 58
Why are you attempting to do this???? You have no real reason to........


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, 09:59 PM   #3
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, 10:16 PM   #4
LQ Newbie
Registered: Jan 2007
Distribution: Ubuntu 6.06, Debian etch, RHEL4
Posts: 1

Rep: Reputation: 0
Solution if needed still


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:
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:
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 10:20 PM.
Old 01-16-2007, 11:57 PM   #5
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
i think this old gcc3 patch will fix it
download this to outside the build directory
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
Old 04-19-2007, 08:08 PM   #6
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,

- "(): 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, 03:37 PM   #7
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, 08:12 AM   #8
LQ Newbie
Registered: Dec 2006
Posts: 4

Rep: Reputation: 0
hanks guys that patch worked perfect
Old 03-11-2015, 03:06 PM   #9
Registered: Oct 2014
Location: U.S.A.
Distribution: mixed, mostly debian slackare today
Posts: 207

Rep: Reputation: 19
Note resolved above

#ifdef __GNUC__

is wrong because ?cywin? at gcc has been hacking incompatible changes that break past code that had worked - apparently needlessly

infact gcc's documents still say "__FUNCTION" works however

printf(__FUNCTION__"hello\n"); // FAILS

only thing to do is be specific: patch it to test all __FOO in question ...

i've been seeing in past allot of hacks like __bsd __linux. test what you need not a generalism - because if they can break it i think they will - i think they look for things to break


cd "$dir/"
[ ! -f glib.h.old ] && {
cp glib.h glib.h.old
cat << EOF | ed || true
r glib.h
#if defined(__GNUC__) && defined(__FUNCTION__) && defined(__PRETTY_FUNCTION__)
wq glib.h
cd "$pwd/
Old 03-12-2015, 05:22 PM   #10
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,602

Rep: Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648

please start a new thread and not necro post to a thread that was last used in 2008


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 03:31 AM
what is glib and why does MC need it to compile zbenjudah Linux - Newbie 4 05-08-2006 01: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 09:12 PM
GTK+ compile error : glib-mkenums Sjaaksken SUSE / openSUSE 6 12-11-2005 03:16 PM
glib-2.4.0 compile error trollman Linux - Software 2 04-09-2004 09:37 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:59 AM.

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