Welcome to the most active Linux Forum on the web.
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 01-30-2015, 01:01 PM   #1
Registered: Oct 2014
Location: U.S.A.
Distribution: mixed, mostly debian slackare today
Posts: 207

Rep: Reputation: 19
glibc glib-2.25.16 error: 'g__cancellable_lock' undeclared

compiling glibc MANY have gotten stopped build with this compile error:

error: 'g__cancellable_lock' undeclared

NOTE: THERE ARE MANY BOGUS FORUMS POSTING WRONG CAUSE AND WRONG SOLUTION. specifically: it does not mean you should disable threads as says.

check config.log if you see this then you did options wrong

checking for thread implementation... no

I have build GNU/Linux (circa 2010 source codes) from termcap to X11R7.6, and all required inbtween). Tens of pkgs needed given the verions i chose to build as the "toolchain": glib had two (threads err, and msgctxt err).

glib's configure script uses --?thread option in an non-standard way comparable to others and does NOT detect pthreads automatically (which most others do).

read "./configure --help" carefully and litterally, do not use --enable-threads=yes, nor --enable-pthreads: use only --with-threads=posix

# you'll now see configure prints this:

checking for thread implementation... posix
checking thread related cflags... -pthread
checking for sched_get_priority_min... yes
checking thread related libraries... -pthread

other wrong advice i found is to rewrite gcancellable.c so that attempts to lock are simply skipped (assume thread support IS OFF i hope). wrong because for gnu/linux (esp debian) you have threads you simply didn't use your options right

>> + G_LOCK(cancellable);
>> +#endif
>> +/*only for cancellable*/


unix has had posix threads for many years (many decades perhaps)

many first get an error message while compiling glibc (std C lib) "...atomic...lock is undefined" if they goof the configure option for compiling gcc4. on non-gnu or none linux your mileage may vary?

if your using GNU/Linux "i386-pc-linux-gnu" then when gcc-4.4.5 was made it SHOULD HAVE been given options to enable posix threads (which isn't default you have to give options to configure)

all it does is gives gcc a "built-in" for using the CPU's "LOCK" command (the assembler instruction: LOCK. very minute ability and very troublesome if it is not added). an ASM (.S) program or linux call could activate the LOCK instruction (infact there are ?15 atomic libs? not very atomic then?) but that's irrelevant since when programs compile /usr/include/pthreads.h needs to "just work". <pthreads.h> works in gnu/linux by it being built-in to gcc, gcc installs ptheads.h

(obvioulsy on non-gnu systems <pthreads.h> will #define things so that the applications get their LOCK command even if it is not in the non-gnu compiler)

Last edited by debguy; 01-30-2015 at 01:06 PM. Reason: necessary subtopic added


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
[SOLVED] getting an error -- undeclared CLOCK_PROCESS_CPUTIME_ID iqra Programming 9 07-09-2010 04:05 PM
error: ‘LOGGING_FACILITY’ undeclared (first use in this function) nasim751 Linux - Software 1 04-19-2008 05:55 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
Upgrading to glibc-2.3.2 from GLIB 1.2.10 MatthewASmith79 Linux - Newbie 4 04-08-2004 10:29 PM
just wondering.. what is the role of glib or glibc or whatever..? kublador Linux - Newbie 5 07-28-2003 01:17 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:24 PM.

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