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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-07-2006, 09:24 PM
|
#1
|
LQ Newbie
Registered: May 2006
Location: Coventry, UK
Distribution: CentOS 5
Posts: 15
Rep:
|
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 09:27 PM.
|
|
|
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:
|
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
|
|
|
10-08-2006, 09:59 PM
|
#3
|
Member
Registered: Jul 2005
Location: Vietnam
Distribution: Fedora Core 2
Posts: 55
Rep:
|
intramaweb: what's your gcc version ?
Did you try older gcc ? May be gcc-2.95.3 is good (at least)
|
|
|
01-16-2007, 10:16 PM
|
#4
|
LQ Newbie
Registered: Jan 2007
Distribution: Ubuntu 6.06, Debian etch, RHEL4
Posts: 1
Rep:
|
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 10:20 PM.
|
|
|
01-16-2007, 11:57 PM
|
#5
|
Member
Registered: Oct 2006
Posts: 460
Rep:
|
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
|
|
|
04-19-2007, 08:08 PM
|
#6
|
LQ Newbie
Registered: Apr 2007
Posts: 6
Rep:
|
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.
|
|
|
09-28-2007, 03:37 PM
|
#7
|
Member
Registered: May 2006
Distribution: OpenSuse 11, Red Hat, Fedora
Posts: 34
Rep:
|
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.
|
|
|
04-23-2008, 08:12 AM
|
#8
|
LQ Newbie
Registered: Dec 2006
Posts: 4
Rep:
|
hanks guys that patch worked perfect
|
|
|
03-11-2015, 03:06 PM
|
#9
|
Member
Registered: Oct 2014
Location: U.S.A.
Distribution: mixed, mostly debian slackare today
Posts: 207
Rep:
|
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
pwd="$PWD"
dir=glib-1.2.10
cd "$dir/"
[ ! -f glib.h.old ] && {
cp glib.h glib.h.old
cat << EOF | ed || true
r glib.h
275
.,.d
.i
#if defined(__GNUC__) && defined(__FUNCTION__) && defined(__PRETTY_FUNCTION__)
.
wq glib.h
EOF
}
cd "$pwd/
|
|
|
03-12-2015, 05:22 PM
|
#10
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,639
|
debguy
please start a new thread and not necro post to a thread that was last used in 2008
|
|
|
All times are GMT -5. The time now is 02:24 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|