Error Xlib Required Due To Xinitthreads
Contents |
privilege escalation with x11/kde4-workspace and openpam Next message: ports/162737: multimedia/vlc: aa.c:42:4: error: how to call xinitthreads #error Xlib required due to XInitThreads # error
Xinitthreads Python
Xlib required due to XInitThreads Messages sorted by: [ date ] [ thread
Xinitthreads Has Not Been Called
] [ subject ] [ author ] >Number: 162737 >Category: ports >Synopsis: multimedia/vlc: aa.c:42:4: error: #error Xlib required due to XInitThreads #
Xinitthreads Undefined Reference
error Xlib required due to XInitThreads >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 21 21:00:20 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Oliver Hartmann >Release: FreeBSD 10.0-CURRENT/amd64 >Organization: FU Berlin >Environment: >Description: xinitthreads example Updating or recompiling multimedia/vlc fails with the following error. The compilation was performed on FreeBSD 10.0 either with clang or the legacy gcc 4.2 without success. Also the workaround UNAME_r "9.9-CURRENT" has bee used as well as a setting of # BUGFIX FreeBSD 10.0 WITH_FBSD10_FIX =YES in /etc/make.conf. All without success. I also recompiled everything necessary for vlc via portmaster -r vlc without success. gmake[5]: Leaving directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_filter' gmake[4]: Leaving directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_filter' gmake[3]: Leaving directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_filter' Making all in video_output gmake[3]: Entering directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_output' gmake all-recursive gmake[4]: Entering directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_output' Making all in msw gmake[5]: Entering directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_output/msw' gmake all-am gmake[6]: Entering directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_output/msw' gmake[6]: Nothing to be done for `all-am'. gmake[6]: Leaving directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_output/msw' gmake[5]: Leaving directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_output/msw' gmake[5]: Entering directory `/usr/ports/multimedia/vlc/work/vlc-1.1.12/modules/video_output' CC libaa_plugin_la-aa.lo CC libaa_plugin_la-keythre
has been at the heart of most graphical applications and user interface frameworks on Unices, including GNU/Linux. It is also xinitthreads qt knows as libX11, the actual name of the shared library in the xlockdisplay file system. Unfortunately - and given its age, perhaps unsurprisingly - it suffers from some rather troublesome limitations and undefined reference to symbol 'xinitthreads' designs mistakes. This brought a few smart developers to create XCB, the X C Bindings, a better library around the X11 window system protocol. Nevertheless, 7 years after the inception https://lists.freebsd.org/pipermail/freebsd-ports-bugs/2011-November/223130.html of XCB, Xlib remains the dominant library to use X11 to this day. Error handling Error handling is certainly the most obvious annoyance when programming Xlib. Of all the software libraries I know, Xlib is the one with the most confusing (or maybe confused?) and inflexible error handling scheme. First, Xlib assumes that any error is fatal by default. Practically, any error http://www.remlab.net/op/xlib.shtml will cause the entire process to abort, where most libraries choose to simply return an error value. Unhandled Xlib errors look like this error messages: X Error of failed request:BadMatch (invalid parameter attributes) Major opcode of failed request:145 (MIT-SHM) Minor opcode of failed request:4 (X_ShmGetImage) Serial number of failed request:10 Current serial number in output stream:12 ... and then the program exits immediately. To catch errors and handle them other than by an early exit, two functions are provided: int (*XSetErrorHandler(int (*handler)(Display *, XErrorEvent *)))(); int (*XSetIOErrorHandler(int (*handler)(Display *)))(); Those prototypes (straight from the Xlib documentation) look a bit confusing. Both functions accept a function pointer as parameter and return a function pointer of the same type, which is the previous error handler. The following equivalent prototypes are easier to read: typedef int (*XErrorHandler)(Display *, XErrorEvent *); typedef int (*XIOErrorHandler)(Display *); XErrorHandler XSetErrorHandler(XErrorHandler handler); XIOErrorHandler XSetIOErrorHandler(XIOErrorHandler handler); XSetIOErrorHandler sets the handler for I/O errors, which is to say for when the connection with the X server fails. Most programs want to quit when this happens, which Xlib does. Still, a callback
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack http://stackoverflow.com/questions/17421690/when-do-i-have-to-call-xinitthreads Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up When do I have to call XInitThreads? up vote 2 down vote favorite I understand that if undefined reference there are two or more threads sharing a single X display connection, XInitThreads must be called before any other Xlib call. But what if every thread has its own connection to the display and operates only on that connection? Is XInitThreads still necessary? And does it make difference if I use the GLX extension? multithreading xlib glx share|improve this question asked Jul 2 '13 at 9:14 hpsMouse 1,297816 add a comment| error xlib required 1 Answer 1 active oldest votes up vote 0 down vote From the documentation: It is only necessary to call this function if multiple threads might use Xlib concurrently. If all calls to Xlib functions are protected by some other access mechanism (for example, a mutual exclusion lock in a toolkit or through explicit client programming), Xlib thread initialization is not required. It is recommended that single-threaded programs not call this function. So, it seems that even if the threads use different connections, XInitThreads must be called. I suggest you to call XInitThread just before you create your threads. This way everything should be OK. share|improve this answer answered Jul 6 '13 at 16:27 johnfound 3,7331729 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged multithreading xlib glx or ask your own question. asked 3 years ago viewed 704 times active 3 years ago Related 0Multithreaded game program suddenly locks up on glXSwapBuffers1107C++11 introduced a standardi