x11 xlib h нет такого файла или каталога
fatal error: X11/Xlib.h: No such file or directory when import mujoco_py #336
Comments
huiwenzhang commented Dec 28, 2018 •
Describe the bug
When import the module, compile failed with error
Traceback (most recent call last):
File «», line 1, in
File «/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/init.py», line 3, in
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File «/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/builder.py», line 503, in
cymj = load_cython_ext(mjpro_path)
File «/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/builder.py», line 105, in load_cython_ext
cext_so_path = builder.build()
File «/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/builder.py», line 220, in build
built_so_file_path = self._build_impl()
File «/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/builder.py», line 290, in _build_impl
so_file_path = super()._build_impl()
File «/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/builder.py», line 243, in _build_impl
dist.run_commands()
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/dist.py», line 955, in run_commands
self.run_command(cmd)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/dist.py», line 974, in run_command
cmd_obj.run()
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py», line 186, in run
_build_ext.build_ext.run(self)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/command/build_ext.py», line 339, in run
self.build_extensions()
File «/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/builder.py», line 143, in build_extensions
build_ext.build_extensions(self)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py», line 194, in build_extensions
self.build_extension(ext)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/command/build_ext.py», line 533, in build_extension
depends=ext.depends)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/ccompiler.py», line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/unixccompiler.py», line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command ‘gcc’ failed with exit status 1
Error Messages
fatal error: X11/Xlib.h: No such file or directory.
Desktop (please complete the following information):
Additional context
I find the Xlib.h file with `locate’ command and get:
/home/huiwen/anaconda3/pkgs/xorg-libx11-1.6.5-0/include/X11/Xlib.h
/home/xiaoning/anaconda3/envs/py35/include/X11/Xlib.h
/home/xiaoning/anaconda3/pkgs/xorg-libx11-1.6.6-h470a237_0/include/X11/Xlib.h
/usr/include/X11/Xlib.h
/usr/lib/x86_64-linux-gnu/perl5/5.22/Tk/pTk/Xlib.h
The text was updated successfully, but these errors were encountered:
Xlib.h not found when building graphviz on Mac OS X 10.8 (Mountain Lion)
When using homebrew to install graphviz, the script gets to the point of «Making install in tkstubs» and then throws the following fatal error:
I have installed XQuartz as X11 has been dropped in Mountain Lion, but I’m unsure if it is installed correctly. The location of Xlib.h is:
There are also two symlinks to /opt/X11, they are:
Does this look like the correct setup to you? I’ve never dealt with X11 or XQuartz until yesterday.
8 Answers 8
After installing XQuartz you may add a symlink to your X11 installation folder by just entering
in terminal. That will fix the problem as well without changing any ruby script.
You need to tell the tkstubs build (and possibly other bits in the package as well) to look for headers in /opt/X11/include ; this is not on the standard include path.
For reasonably modern configure scripts, the best approach is to pass it in the environment variable CPPFLAGS ; if the package uses another build system or this doesn’t work for another reason, then you need to look at the Makefile in the build directory.
You can enter in your shell before the compile/link (or brew) command:
The export line will tell the compile/linker to look in /opt/X11/include for the X11 include files
Had the same issue and running this command on terminal
worked for me. Run this command after installing xQuartz.
If you need this to work in your CMake builds:
That worked well for me.
I got it to install by copying the x11 header file directory to the /opt/local/include directory. Probably not the best way to work around it but quick and easy.
Since the make file is looking for X11/xlib.h i.e., it is looking for X11 folder in the current directory, one way to solve this problem is to simply copy the /opt/X11/include/X11 directory to the directory that contains make file.
So, if anyone is ever in the same boat, my solution was this:
The solution is to add to your PKG_CONFIG_PATH environment variable. Mine was nonexistent, so I just did export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ (the folder where I found xbc.pc ).
I reran configure and everything worked like a charm!
X11/Xlib.h не найден в Ubuntu
Я пытаюсь написать довольно тривиальную программу, используя open gl на linux, но во время компиляции она говорит:
4 ответа
Быстрый поиск с помощью.
Включает пакет libx11-dev, но вам это не нужно для чистого программирования OpenGL. Какой учебник вы используете?
Вы можете добавить Xlib.h в свою систему, выполнив следующие действия.
Предположим, он использует учебник из http://www.arcsynthesis.org/gltut/ вместе с premake4.3 🙂
После чего я мог бы построить glsdk_0.4.4 и примеры без дальнейших проблем.
Ответа Эндрю Уайта достаточно, чтобы заставить вас двигаться дальше. Вот step-by-step для начинающих.
Простое начало работы:
Create test.cpp: (Это будет построено и запущено, чтобы убедиться, что вы все настроили правильно.)
Если ваш ответ будет:
вам необходимо установить X11 библиотек разработки. sudo apt-get install libx11-dev
Если это сработает, ты в золоте.
Протестировано с использованием новой установки libX11-dev_2%3a1.5.0-1_i386.deb
Если есть попадание, у вас есть Xlib.h
Если нет, установите его с помощью sudo apt-get install libx11-dev
и тебе хорошо идти 🙂
Я устанавливаю muPDF. Я дал ввод типа make prefix=/usr/local install в terminal Я уже установил XQuartz Но я получаю следующую ошибку In file included from thirdparty/glfw/src/context.c:28: In file included from thirdparty/glfw/src/internal.h:85: thirdparty/glfw/src/x11_platform.h:35:10: fatal.
Похожие вопросы:
При использовании homebrew для установки graphviz скрипт добирается до точки Making install in tkstubs и затем выдает следующую фатальную ошибку: In file included from tkStubLib.c:15.
Я сделал программу C, которая принимает значения RGB (0-255) пикселя экрана,зная его положение (x, y). Он работает в Linux, но когда я пытаюсь скомпилировать его в Visual Studio (Windows).
Я устанавливаю muPDF. Я дал ввод типа make prefix=/usr/local install в terminal Я уже установил XQuartz Но я получаю следующую ошибку In file included from thirdparty/glfw/src/context.c:28: In file.
Я пишу программу, которая использует метод XGetPixel(). Однако при его использовании я получаю сообщение об ошибке Error: XGetPixel was not declared in this scope Мой код выглядит следующим образом.
X11 xlib h нет такого файла или каталога
Итак, для начала нам необходимы следующие вещи: какая-нибудь, похожая на Unix система, работающий и доступный X-сервер, компилятор языка C++, библиотека Xlib. Это самые необходимые компоненты для написания программы. Собственно говоря, C++ на первых порах будет вовсе не обязателен, но в дальнейшем, для написания программ со сложными графическими интерфейсами, лучше прибегнуть к приемам объектно-ориентированного программирования.
Напишем самое простое приложение. Просто подключимся к графическому терминалу, узнаем о нем кое-какие сведения и отключимся. Для этого нам потребуются две функции: XOpenDisplay, XCloseDisplay, а также структура данных Display.
Для GNU/Linux, распространяемого компанией Red Hat, команду компиляции можно написать следующим образом:
Если при компиляции возникают ошибки, то вероятнее всего или у Вас нет библиотеки Xlib, или сама библиотека находятся в другом месте, или файлы заголовков находятся в каталоге вне дерева стандартного подключения заголовков. Также, возможно, что вы перепутали компилятор и решили скомпилировать программу компилятором паскаля.
Поскольку фирмы, занимающиеся компоновкой юникс систем не выработали общих правил формирования дерева каталогов, часто возникают проблемы при компиляции программ. К примеру, системы использующие сервер XFree86 обычно используют каталог /usr/X11R6 как каталог системы X-Window, а коммерческие юниксы используют каталог /usr/X11. Также есть экзотический вариант расположения в каталоге /opt/X/bin/X11. Самый простой выход для пользователя в этом случае сделать линки с альтернативными названием каталога, чтобы не копаться в скриптах или пакетных файлах компиляции. Впрочем, уже много программных продуктов, выпущенных в последнее время на этапе подготовки к компиляции настраиваются на ту иерархию каталогов, которая существует на машине пользователя. Последнее ложится на плечи разработчиков программного обеспечения. Поскольку мы хотим к ним относиться, то придётся в одной из глав уделить этому внимание.
Итак, предположим программа удачно скомпилировалась. Если она удачно запустилась и выдала всю необходимую информацию, то значит у нас все правильно настроено. Если не запустилась, необходимо разобраться в чём дело.
dlib C++ Library
Brought to you by: davisking
Forums
building dlib OS X 10.11
I was trying to build dlib on Mac OS X 10.11. I have X11 installed via
XQuartz (so DLIB_NO_GUI_SUPPORT is OFF). When I run make I get the
following error.
In file included from /dlib/dlib/gui_widgets/fonts.cpp:14:
/dlib/dlib/gui_widgets/nativefont.h:27:10: fatal error: ‘X11/Xlib.h’ file
not found
include
The problem is that xlib_path is set to /usr/include instead of
/opt/X11/include, which is because find_path(Xlocale.h) finds
/usr/include/xlocale.h (the case is different but HFS+ is case insensitive
by default).
I tried using find_package(X11). This works for the current version of
CMake (3.4) and OS X. CMake has provided a FindX11.cmake script since 2.4
(although I don’t believe that version would find current X11 installs).
You could also search for X11/Xlocale.h instead of providing PATH_SUFFIX
(and then appending X11 onto the path it finds).
Super. At some point in the distant past cmake’s built in X11 find methods
didn’t work well on OS X.
In any event, I just updated the cmake scripts. Can you grab the latest
copy from github and see if it works on mac (I don’t have a mac to test
on)? https://github.com/davisking/dlib
Yeah. That worked. Thanks
The CMake DLIB_NO_GUI_SUPPORT option should also be of type bool instead of
string.
On Sun, Jan 10, 2016 at 2:04 PM, Scott Richardson scott.richardson@visionsystemsinc.com wrote:
I was trying to build dlib on Mac OS X 10.11. I have X11 installed via
XQuartz (so DLIB_NO_GUI_SUPPORT is OFF). When I run make I get the
following error.
In file included from /dlib/dlib/gui_widgets/fonts.cpp:14:
/dlib/dlib/gui_widgets/nativefont.h:27:10: fatal error: ‘X11/Xlib.h’ file
not found
include
The problem is that xlib_path is set to /usr/include instead of
/opt/X11/include, which is because find_path(Xlocale.h) finds
/usr/include/xlocale.h (the case is different but HFS+ is case insensitive
by default).
I tried using find_package(X11). This works for the current version of
CMake (3.4) and OS X. CMake has provided a FindX11.cmake script since 2.4
(although I don’t believe that version would find current X11 installs).
You could also search for X11/Xlocale.h instead of providing PATH_SUFFIX
(and then appending X11 onto the path it finds).