Hello, I’m getting an error when I try to compile DWM with musl-gcc. I was assuming suckless software have musl-libc support because it’s one of their recommendations so I don’t think that’s the problem.
The only patch i already have installed is xrdb and the patch I’m trying to patch in is fullgaps
[user@host dwm]$ make
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -O3 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION="6.2" -DXINERAMA
LDFLAGS = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft
CC = musl-gcc
musl-gcc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -O3 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION="6.2" -DXINERAMA drw.c
drw.c:5:10: fatal error: X11/Xlib.h: No such file or directory
5 | #include <X11/Xlib.h>
| ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:18: drw.o] Error 1
I know I have /X11/Xlib.h because when I do locate I find it:
[user@host dwm]$ locate Xlib.h
/usr/include/X11/Xlib.h
/usr/share/gtk-doc/html/gdk-pixbuf/Xlib.html
I tried changing ‘-I/usr/X11R6/include’ to ‘-I/usr/include/’, but that broke other links. I’m new to suckless software and therefore quite new to compiling myself so I don’t have the knowledge of how to fix the config.mk and just tested around with no real luck.
PS: I know you’re not really supposed to use -O3 but suckless software is so small that I didn’t really think it would fuck anything up. (It didn’t have any effect changing it either.)
Содержание
- fatal error: X11/Xlib.h: No such file or directory when import mujoco_py #336
- Comments
- Missing deps(?): spack install tr gives fatal error: X11/Xlib.h: No such file or directory #3047
- Comments
- Troubleshooting
- Workaround
- Details
- Session info
- X11/Xlib.h’ file not found
- Minbari
- ljboiler
- Minbari
- ralphbsz
- Thread: fatal error: X11/Xlib.h:
- fatal error: X11/Xlib.h:
- Re: fatal error: X11/Xlib.h:
- Re: fatal error: X11/Xlib.h:
- Re: fatal error: X11/Xlib.h:
- Re: fatal error: X11/Xlib.h:
- Re: fatal error: X11/Xlib.h:
- Re: fatal error: X11/Xlib.h:
fatal error: X11/Xlib.h: No such file or directory when import mujoco_py #336
Describe the bug
When import the module, compile failed with error
import mujoco_py
running build_ext
building ‘mujoco_py.cymj’ extension
gcc -pthread -B /home/huiwen/anaconda3/envs/gail/compiler_compat -Wl,—sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py -I/home/huiwen/.mujoco/mjpro150/include -I/home/huiwen/anaconda3/envs/gail/lib/python3.6/site-packages/numpy/core/include -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/vendor/egl -I/home/huiwen/anaconda3/envs/gail/include/python3.6m -c /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/cymj.c -o /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/generated/_pyxbld_1.50.1.68_36_linuxgpuextensionbuilder/temp.linux-x86_64-3.6/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/cymj.o -fopenmp -w
gcc -pthread -B /home/huiwen/anaconda3/envs/gail/compiler_compat -Wl,—sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py -I/home/huiwen/.mujoco/mjpro150/include -I/home/huiwen/anaconda3/envs/gail/lib/python3.6/site-packages/numpy/core/include -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/vendor/egl -I/home/huiwen/anaconda3/envs/gail/include/python3.6m -c /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglshim.c -o /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/generated/_pyxbld_1.50.1.68_36_linuxgpuextensionbuilder/temp.linux-x86_64-3.6/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglshim.o -fopenmp -w
In file included from /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/egl.h:39:0,
from /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglshim.c:2:
/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglplatform.h:99:10: fatal error: X11/Xlib.h: No such file or directory
#include
compilation terminated.
Traceback (most recent call last):
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/unixccompiler.py», line 118, in _compile
extra_postargs)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/ccompiler.py», line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/spawn.py», line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/spawn.py», line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command ‘gcc’ failed with exit status 1
During handling of the above exception, another exception occurred:
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):
- OS: [Ubutnu 16.04]
- Python Version [3.6.4]
- Mujoco Version [ 1.50]
- mujoco-py version [e.g. 1.50.1.68]
- GCC version [7.2.0]
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
It does exist. However, I have no idea why the system can’t find it. It seems that the gcc -I command don’t include the system header path. However, I don’t know how to config conda to make it link the default system path.
The text was updated successfully, but these errors were encountered:
Источник
Missing deps(?): spack install tr gives fatal error: X11/Xlib.h: No such file or directory #3047
tr comes with variant X and it’s off by default:
I get a build error when running (*):
suggesting that Tk still needs to #include when being built (full details below).
BTW, I noticed this error when trying to install R as spack install r , which in turn depends on tk meaning the above error was a showstopper. With my below workaround Tk and R installs.
Troubleshooting
However, repos/builtin/packages/tk/package.py only includes libx11 only when variant X is enabled (i.e. using +X ):
Workaround
When removing when=’+X’ above (i.e. using depends_on(«libx11») ), then spack install tk installs Tk successfully.
Because of the error message, is the above a bug in repos/builtin/packages/tk/package.py ? I’m happy do a PR, but I’m not sure if this is the proper fix?
Details
.AutotoolsPackage.build_targets« 273 «»» 274 with working_dir(self.build_directory): >> 275 inspect.getmodule(self).make(*self.build_targets) See build log for details: /tmp/hb/spack-stage/spack-stage-zTToCX/tk8.6.6/spack-build.out»>
Session info
The above is on a fresh Centos 7:
with today’s version of Spack 0.10.0 (from git clone https://github.com/llnl/spack.git ).
The text was updated successfully, but these errors were encountered:
I ran into this same problem with the R package in #2864. The problem is that by default, these packages assume you have X11 libraries available and try to build GUI support. With R, you can add the —without-x flag to explicitly disable this, which is what I added in #2864. There may be something equivalent for tk, although @hartzell probably has another suggestion. From what he said, it sounds like tk
X doesn’t make much sense, as tk is an X window toolkit for tcl . Perhaps a better solution would be to have R only depend on tk when=’+X’ ?
You probably know more than I do. Should users generally expect R to be built with tk/tcl support? I disabled X11 support in all of our packages until variant resolution is no longer broken, so they all default to not having tk/tcl support.
From what he said, it sounds like tk
X doesn’t make much sense, as tk is an X window toolkit for tcl. Perhaps a better solution would be to have R only depend on tk when=’+X’?
That sounds right to me.
To cover bases. is the issue reported here on a Mac?
You probably know more than I do. Should users generally expect R to be built with tk/tcl support? I disabled X11 support in all of our packages until variant resolution is no longer broken, so they all default to not having tk/tcl support.
tcltk is one of the core packages. It will always be installed, but if tcltk is not supported;
there will be an (intentional) error when the tcltk package is loaded (directly or indirectly via another R packages), e.g.
The tcltk package can / is used also for non-GUI usages, e.g. it provides a mechanism for running async basic event handling in R although R itself is single-threaded. I don’t know whether tcltk uses pure Tcl for that or Tk. Regardless, from the name «tcltk» I think we can assume that tcltk requires both Tcl+Tk and that Tk is non-optional.
So, tcltk requires Tk and if it’s true that Tk requires X11, and R is designed to also be built without X11, then I think we can safely update to use depends_on(«tk», when = «+X») for the R package.
Источник
X11/Xlib.h’ file not found
Minbari
ljboiler
Reactions: Sschober and Minbari
Minbari
O.K., that tip helped but it still fails to build. Invoking gmake -v tells me the gmake version.
Anyway I’ve solved my problem with the help of x11/xkb-switch and sh scripting. I’m guessing the next step it’s to mark the thread: solved or since the initial problem is not solved, xkblayout-state build fails the thread should remain open?
ralphbsz
If you have to use the -I switch in your make file to find the header files while compiling, you probably also have to use the -L switch to find link libraries while linking. Most likely simply adding «-L /usr/local/lib» will already be sufficient. But you really need to understand how make files work, how the -I and -L switches work, and that the layout (install location) of header files and link libraries can be different on different OSes. You should probably start by looking where the X11 installation lives on your computer.
I think since the second problem is a direct followup to the first one, using the same thread is a space-saving measure.
Источник
Thread: fatal error: X11/Xlib.h:
Thread Tools
Display
fatal error: X11/Xlib.h:
hi. i am using ubuntu 12.04 and trying to install NS2.35
for that matter i downloaded ns-allinone-2.35, unzipped it, started installation, the installation went well until it gave an error message and stopped. the error message is as follows:
: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [tk3d.o] Error 1
tk8.5.10 make failed! Exiting .
I’m pretty sure that I do have Xlib.h at the right place. i also tried to do this ‘sudo apt-get install libx11-dev’ but it returned me the following:
«Package libx11-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘libx11-dev’ has no installation candidate
in desperate search to an immediate solution.
Re: fatal error: X11/Xlib.h:
Re: fatal error: X11/Xlib.h:
Is this what you are looking for?:
If that’s not it then just do a search for libx11 or x11 in your package manager.
Re: fatal error: X11/Xlib.h:
while installing, tcl was installed successfully, but when it came to tk, it gave the following messages:
#* TAGS *.E a.out
errors wish tktest lib.exp Tk *.rsrc
rm -rf Makefile config.status config.cache config.log tkConfig.sh
SCRPtk.* prototype tkConfig.h *.plist Tk.framework
./install: 439: ./install: autoconf: not found
checking for Tcl configuration. found /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix/tclConfig.sh
checking for existence of /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix/tclConfig.sh. loading
checking for tclsh. /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/bin/tclsh8.5
checking for tclsh in Tcl build directory. /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix/tclsh
checking whether to use symlinks for manpages. no
checking whether to compress the manpages. no
checking whether to add a package name suffix for the manpages. no
checking for gcc. gcc
checking for C compiler default output file name. a.out
checking whether the C compiler works. yes
checking whether we are cross compiling. no
checking for suffix of executables.
checking for suffix of object files. o
checking whether we are using the GNU C compiler. yes
checking whether gcc accepts -g. yes
checking for gcc option to accept ANSI C. none needed
checking how to run the C preprocessor. gcc -E
checking for egrep. grep -E
checking for ANSI C header files. yes
checking for sys/types.h. yes
checking for sys/stat.h. yes
checking for stdlib.h. yes
checking for string.h. yes
checking for memory.h. yes
checking for strings.h. yes
checking for inttypes.h. yes
checking for stdint.h. yes
checking for unistd.h. yes
checking limits.h usability. yes
checking limits.h presence. yes
checking for limits.h. yes
checking for stdlib.h. (cached) yes
checking if the compiler understands -pipe. yes
checking for building with threads. no (default)
checking how to build libraries. static
checking for ranlib. ranlib
checking if 64bit support is requested. no
checking if 64bit Sparc VIS support is requested. no
checking if compiler supports visibility «hidden». yes
checking if rpath support is requested. yes
checking system version. Linux-3.2.0-26-generic
checking for dlopen in -ldl. yes
checking for ar. ar
checking for build with symbols. no
checking for required early compiler flags. _LARGEFILE64_SOURCE
checking for 64-bit integer type. using long
checking whether byte ordering is bigendian. no
checking for fd_set in sys/types. yes
checking sys/time.h usability. yes
checking sys/time.h presence. yes
checking for sys/time.h. yes
checking whether time.h and sys/time.h may both be included. yes
checking for strtod. yes
checking for Solaris2.4/Tru64 strtod bugs. ok
checking for mode_t. yes
checking for pid_t. yes
checking for size_t. yes
checking for uid_t in sys/types.h. yes
checking for intptr_t. yes
checking for uintptr_t. yes
checking pw_gecos in struct pwd. yes
checking for X. no
checking for X11 header files. couldn’t find any!
checking for X11 libraries. checking for XCreateWindow in -lXwindow. no
could not find any! Using -lX11.
checking for main in -lXbsd. no
checking whether to try to use XScreenSaver. no
checking whether to use xft. no
checking whether char is unsigned. no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tkConfig.sh
gcc -c -O2 -pipe -Wall -fPIC -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../unix -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../bitmaps -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/generic -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix -DPACKAGE_NAME=»tk» -DPACKAGE_TARNAME=»tk» -DPACKAGE_VERSION=»8.5» -DPACKAGE_STRING=»tk 8.5» -DPACKAGE_BUGREPORT=»» -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DSTATIC_BUILD=1 -DMODULE_SCOPE=extern __attribute__((__visibility__(»hidden»))) -DTCL_SHLIB_EXT=».so» -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_PW_GECOS=1 -DTCL_NO_DEPRECATED /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tk3d.c
In file included from /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tkInt.h:19:0,
from /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tk3d.c:14:
/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [tk3d.o] Error 1
tk8.5.10 make failed! Exiting .
one more thing is that while doing ‘sudo apt-get update’ it gives me the failure installing packages of X because of unreachable site, it gives me Err http://linux.ntuoss.org precise/universe amd64 Packages
@dodo3773! may be what you suggested is the right place from where i can get amd updation, but i really have no idea about how to do it. need help
keeping in mind that m using 64bit machine.
Re: fatal error: X11/Xlib.h:
Go into your package manager to install the packages you need. Should be called «Software Center» or something similar. Search for it.
Re: fatal error: X11/Xlib.h:
hi tried installing ns-2 2.35 in ubuntu 12.04 n i got the following error..
TR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 /home/msit123/ns-allinone-2.35/tcl8.5.10/unix/../unix/tclAppInit.c
gcc -O2 -pipe -Wl,—export-dynamic tclAppInit.o -L/home/msit123/ns-allinone-2.35/tcl8.5.10/unix -ltcl8.5 -ldl -lieee -lm
-Wl,-rpath,/home/msit123/ns-allinone-2.35/lib -o tclsh
tcl8.5.10 make succeeded.
Installing libtcl8.5.a to /home/msit123/ns-allinone-2.35/lib/
cp: cannot create regular file `/home/msit123/ns-allinone-2.35/lib/#inst.14705#’: Permission denied
rm: cannot remove `/home/msit123/ns-allinone-2.35/lib/libtcl8.5.a’: Permission denied
mv: cannot stat `/home/msit123/ns-allinone-2.35/lib/#inst.14705#’: No such file or directory
ranlib: could not create temporary file whilst writing archive: No more archived files
make: *** [install-binaries] Error 1
tcl8.5.10 installation failed.
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.
msit123@msit123-Studio-1435:
Re: fatal error: X11/Xlib.h:
Check the file permissions and the ownership.
PS.
Please start your own thread. Your problem has nothing to do with that of the OP.
Источник
Describe the bug
When import the module, compile failed with error
import mujoco_py
running build_ext
building ‘mujoco_py.cymj’ extension
gcc -pthread -B /home/huiwen/anaconda3/envs/gail/compiler_compat -Wl,—sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py -I/home/huiwen/.mujoco/mjpro150/include -I/home/huiwen/anaconda3/envs/gail/lib/python3.6/site-packages/numpy/core/include -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/vendor/egl -I/home/huiwen/anaconda3/envs/gail/include/python3.6m -c /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/cymj.c -o /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/generated/_pyxbld_1.50.1.68_36_linuxgpuextensionbuilder/temp.linux-x86_64-3.6/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/cymj.o -fopenmp -w
gcc -pthread -B /home/huiwen/anaconda3/envs/gail/compiler_compat -Wl,—sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py -I/home/huiwen/.mujoco/mjpro150/include -I/home/huiwen/anaconda3/envs/gail/lib/python3.6/site-packages/numpy/core/include -I/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/vendor/egl -I/home/huiwen/anaconda3/envs/gail/include/python3.6m -c /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglshim.c -o /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/generated/_pyxbld_1.50.1.68_36_linuxgpuextensionbuilder/temp.linux-x86_64-3.6/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglshim.o -fopenmp -w
In file included from /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/egl.h:39:0,
from /home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglshim.c:2:
/home/huiwen/paper/learn-from-video/mujoco-py/mujoco_py/gl/eglplatform.h:99:10: fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>
compilation terminated.
Traceback (most recent call last):
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/unixccompiler.py», line 118, in _compile
extra_postargs)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/ccompiler.py», line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/spawn.py», line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File «/home/huiwen/anaconda3/envs/gail/lib/python3.6/distutils/spawn.py», line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command ‘gcc’ failed with exit status 1
During handling of the above exception, another exception occurred:
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):
- OS: [Ubutnu 16.04]
- Python Version [3.6.4]
- Mujoco Version [ 1.50]
- mujoco-py version [e.g. 1.50.1.68]
- GCC version [7.2.0]
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
It does exist. However, I have no idea why the system can’t find it. It seems that the gcc -I command don’t include the system header path. However, I don’t know how to config conda to make it link the default system path.
I’m trying to compile this code here: http://lists.kde.org/?l=kwin&m=115435217715650&w=2
I compile it with this line of code:
gcc -lX11 -lstdc++ -L/usr/X11/lib -o icon icon.c
but it keeps throwing this error:
icon.c:2:22: fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>
code is:
#include <stdlib.h>
#include <X11/Xlib.h>
int main( int argc, char **argv )
{
unsigned int buffer[] = {16, 16, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 338034905, 3657433343, 0, 184483840,
234881279, 3053453567, 3221225727, 1879048447, 0, 0, 0, 0, 0, 0, 0, 1224737023,
3305111807, 3875537151,0, 0, 2063597823, 1291845887, 0, 67109119, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
50266112, 3422552319, 0, 0, 3070230783, 2063597823, 2986344703, 771752191, 0, 0, 0,
0, 0, 0, 0, 0, 0, 3422552319, 0, 0, 3372220671, 1509949695, 704643327, 3355443455,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 0, 3422552319, 0, 134152192, 3187671295, 251658495, 0, 3439329535, 0, 0,
0, 0, 0, 0, 0, 0, 0, 3422552319, 0, 0, 2332033279, 1342177535, 167772415, 3338666239,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 0, 3422552319, 0, 0, 436207871, 3322085628, 3456106751, 1375731967,
4278255360, 4026597120, 3758161664, 3489726208, 3204513536, 2952855296, 2684419840,
2399207168, 2130771712, 1845559040, 1593900800, 1308688128, 1040252672, 755040000,
486604544, 234946304, 4278255360, 4043374336, 3774938880, 3506503424, 3221290752,
2952855296, 2667642624, 2399207168, 2130771712, 1862336256, 1627453957, 1359017481,
1073805064, 788591627, 503379721, 218169088, 4278255360, 4043374336, 3758161664,
3506503424, 3221290752, 2952855296, 2684419840, 2415984384, 2130771712, 1862336256,
1577123584, 1308688128, 1040252672, 755040000, 486604544, 218169088, 4278190335,
4026532095, 3758096639, 3489661183, 3221225727, 2952790271, 2667577599, 2415919359,
2130706687, 1862271231, 1593835775, 1325400319, 1056964863, 771752191, 520093951,
234881279, 4278190335, 4026532095, 3758096639, 3489661183, 3221225727, 2952790271,
2667577599, 2415919359, 2130706687, 1862271231, 1593835775, 1325400319, 1056964863,
771752191, 503316735, 234881279, 4278190335, 4026532095, 3758096639, 3489661183,
3221225727, 2952790271, 2684354815, 2399142143, 2130706687, 1862271231, 1593835775,
1325400319, 1040187647, 771752191, 520093951, 234881279, 4294901760, 4043243520,
3774808064, 3506372608, 3221159936, 2952724480, 2684289024, 2399076352, 2147418112,
1862205440, 1593769984, 1308557312, 1040121856, 771686400, 503250944, 234815488,
4294901760, 4060020736, 3758030848, 3506372608, 3221159936, 2952724480, 2684289024,
2415853568, 2130640896, 1862205440, 1593769984, 1308557312, 1040121856, 771686400,
503250944, 234815488, 4294901760, 4043243520, 3774808064, 3489595392, 3237937152,
2952724480, 2684289024, 2415853568, 2147418112, 1862205440, 1593769984, 1325334528,
1056899072, 788463616, 503250944, 234815488, 32, 32, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
0, 0, 0, 0, 0, 0, 0, 0, 0, 268369920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 1509949695, 3120562431, 4009754879, 4194304255, 3690987775, 2130706687,
83886335, 0, 50331903, 1694499071, 3170894079, 3992977663, 4211081471, 3657433343,
1879048447, 16777471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3087007999,
2281701631, 1191182591, 1040187647, 2030043391, 4127195391, 2566914303, 0, 16777471,
3254780159, 2181038335, 1191182591, 973078783, 2030043391,4177527039, 2130706687,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 0, 0, 0, 0, 0, 2214592767, 4093640959, 0, 0, 0, 0, 0, 0, 0,
2298478847, 3909091583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2214592767, 3607101695, 0, 0, 0, 0, 0, 0, 0, 1946157311, 4093640959, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 0, 0, 536871167, 1191182591, 2281701631,3019899135, 637534463, 0, 0, 0,
100597760, 251592704, 33488896, 0, 3321889023, 2919235839, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2550137087, 4278190335, 4278190335, 3405775103, 570425599,
0, 0, 0, 0, 0, 0, 2046820607, 4043309311, 620757247, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
33488896, 0, 0, 218104063, 1291845887, 3841982719, 3388997887, 0, 0, 0, 0, 0,
1996488959, 4093640959, 1073742079, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1761607935, 4278190335, 150995199, 0, 0, 67109119, 2550137087,
3909091583, 889192703, 0, 0, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 0, 0, 0, 0, 0,
2181038335, 3925868799, 0, 0, 218104063, 3070230783, 3623878911, 570425599, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 805306623, 3288334591, 1795162367,
1040187647, 1023410431, 2231369983, 4211081471, 1694499071, 0, 369099007, 3456106751,
3825205503, 1174405375, 872415487, 872415487, 872415487, 872415487, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 4294901760,
4293984270, 2046951677, 3422552319, 4110418175, 4177527039, 3405775103, 1409286399,
0, 0, 1409286399, 4278190335, 4278190335, 4278190335, 4278190335, 4278190335,
4278190335, 4278190335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294901760, 4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760,4294901760, 4294901760, 4294901760,
4294901760, 4294901760, 4294901760, 4294901760, 4294901760, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4278255360, 4144037632, 4009819904,
3875602176, 3741384448, 3607166720, 3472948992, 3338731264, 3204513536, 3053518592,
2936078080, 2801860352, 2650865408, 2516647680, 2382429952, 2264989440, 2113994496,
1996553984, 1862336256, 1728118528, 1577123584, 1459683072, 1325465344, 1191247616,
1040252672, 922812160, 771817216, 637599488, 503381760, 385941248, 234946304,
100728576, 4278255360, 4144037632, 4009819904, 3875602176, 3724607232, 3607166720,
3472948992, 3338731264, 3204513536, 3070295808, 2936078080, 2801860352, 2667642624,
2516647680, 2399207168, 2264989440, 2130771712, 1996553984, 1845559040, 1728118528,
1593900800, 1459683072, 1308688128, 1191247616, 1057029888, 922812160, 788594432,
637599488, 503381760, 369164032, 234946304, 117505792, 4278255360, 4144037632,
4009819904, 3875602176, 3741384448, 3607166720, 3472948992, 3338731264, 3204513536,
3053518592, 2919300864, 2801860352, 2650865408, 2533424896, 2399207168, 2264989440,
2113994496, 1996553984, 1862336256, 1728118528,1593900800, 1459683072, 1325465344,
1191247616, 1040252672, 906034944, 771817216, 654376704, 503381760, 369164032,
234946304, 117505792, 4278255360, 4144037632, 4009819904, 3858824960, 3741384448,
3607166720, 3472948992, 3338731264, 3204513536, 3070295808, 2936078080, 2801860352,
2667642624, 2533424896, 2382429952, 2264989440, 2130771712, 1979776768, 1862336256,
1728118528, 1577123584, 1442905856, 1325465344, 1191247616, 1040252672, 922812160,
771817216, 637599488, 503381760, 369164032, 234946304, 100728576, 4278255360,
4144037632, 4009819904, 3875602176, 3741384448, 3607166720, 3472948992, 3338731264,
3204513536, 3070295808, 2919300864, 2801860352, 2667642624, 2533424896, 2399207168,
2264989440, 2113994496, 1996553984, 1862336256, 1728118528, 1593900800, 1442905856,
1342241795, 1174470400, 1057029888, 906034944, 788594432, 654376704, 503381760,
385941248, 251723520, 100728576, 4278190335, 4160749823, 4026532095, 3892314367,
3741319423, 3623878911, 3472883967, 3338666239, 3221225727, 3070230783, 2952790271,
2818572543, 2667577599, 2533359871, 2399142143, 2264924415, 2147483903, 1996488959,
1862271231, 1728053503, 1593835775, 1459618047, 1325400319, 1191182591, 1056964863,
922747135, 788529407, 654311679, 520093951,385876223, 251658495, 117440767,
4278190335, 4160749823, 4026532095, 3892314367, 3741319423, 3623878911, 3489661183,
3355443455, 3221225727, 3087007999, 2936013055, 2801795327, 2667577599, 2533359871,
2399142143, 2281701631, 2130706687, 1996488959, 1862271231, 1728053503,
1593835775,1459618047, 1325400319, 1191182591, 1056964863, 922747135, 788529407,
654311679, 520093951, 385876223, 234881279, 100663551, 4278190335, 4160749823,
4026532095, 3892314367, 3758096639, 3623878911, 3489661183, 3355443455, 3221225727,
3087007999, 2936013055, 2801795327, 2667577599, 2550137087, 2415919359, 2264924415,
2130706687, 1996488959, 1862271231, 1728053503, 1593835775, 1459618047, 1325400319,
1191182591, 1056964863, 922747135, 788529407, 654311679, 503316735, 369099007,
251658495, 100663551, 4278190335, 4160749823, 4026532095, 3892314367, 3758096639,
3623878911, 3489661183, 3355443455, 3204448511, 3087007999, 2936013055, 2818572543,
2667577599, 2533359871, 2399142143, 2264924415, 2130706687, 1996488959, 1879048447,
1728053503, 1593835775, 1459618047, 1325400319, 1191182591, 1056964863, 922747135,
788529407, 654311679, 520093951, 385876223, 251658495, 117440767, 4278190335,
4160749823, 4026532095, 3892314367, 3758096639, 3623878911, 3489661183, 3355443455,
3221225727, 3087007999, 2952790271, 2818572543, 2667577599, 2533359871, 2399142143,
2264924415, 2147483903, 2013266175, 1862271231, 1744830719, 1610612991, 1476395263,
1342177535, 1191182591, 1056964863, 922747135, 788529407, 654311679, 520093951,
385876223, 251658495, 100663551, 4294901760, 4160684032, 4026466304, 3909025792,
3774808064, 3623813120, 3489595392, 3355377664, 3237937152, 3103719424, 2952724480,
2818506752, 2684289024, 2550071296, 2415853568, 2281635840, 2147418112, 2013200384,
1878982656, 1744764928, 1593769984, 1476329472,1325334528, 1207894016, 1056899072,
939458560, 788463616, 654245888, 520028160, 385810432, 251592704, 117374976,
4294901760, 4177461248, 4043243520, 3909025792, 3774808064, 3640590336, 3506372608,
3355377664, 3221159936, 3086942208, 2952724480, 2818506752, 2701066240, 2550071296,
2415853568, 2281635840, 2147418112, 2013200384, 1878982656, 1727987712, 1610547200,
1476329472, 1325334528, 1191116800, 1073676288, 922681344, 788463616, 654245888,
520028160, 385810432, 251592704, 100597760, 4294901760, 4177461248, 4043243520,
3909025792, 3774808064, 3640590336, 3489595392, 3372154880, 3237937152, 3103719424,
2952724480, 2818506752, 2700935170, 2550071296, 2415853568, 2281635840, 2147418112,
2013200384, 1878982656, 1744764928, 1610547200, 1459552256, 1342111744, 1191116800,
1056899072, 922681344, 788463616, 671023104, 520028160, 385810432, 251592704,
100597760, 4294901760, 4177461248, 4043243520, 3909025792, 3774808064, 3640590336,
3489595392, 3372154880, 3237937152, 3086942208, 2969501696, 2818506752, 2684289024,
2550071296, 2432630784, 2281635840, 2147418112, 2013200384, 1862205440, 1744764928,
1610547200, 1476329472, 1342111744, 1191116800, 1056899072, 922681344, 788463616,
654245888, 520028160, 385810432, 251592704, 117374976, 4294901760, 4177461248,
4043243520, 3909025792, 3774808064, 3623813120, 3506372608, 3372154880, 3237937152,
3103719424, 2952724480, 2835283968, 2684289024, 2550071296, 2432630784, 2281635840,
2147418112, 2046492676, 1862205440, 1744764928, 1610547200, 1476329472,
1342111744,1207894016, 1056899072, 939458560, 788463616, 654245888, 536281096,
385810432, 251592704, 134152192};
Display *d = XOpenDisplay(0);
int s = DefaultScreen(d);
Atom net_wm_icon = XInternAtom(d, "_NET_WM_ICON", False);
Atom cardinal = XInternAtom(d, "CARDINAL", False);
Window w;
XEvent e;
w = XCreateWindow(d, RootWindow(d, s), 0, 0, 200, 200, 0,
CopyFromParent, InputOutput, CopyFromParent, 0, 0);
int length = 2 + 16 * 16 + 2 + 32 * 32;
XChangeProperty(d, w, net_wm_icon, cardinal, 32,
PropModeReplace, (const unsigned char*) buffer, length);
XMapWindow(d, w);
while(1) XNextEvent(d, &e);
}
- Forum
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- New to Ubuntu
- [ubuntu] fatal error: X11/Xlib.h:
-
fatal error: X11/Xlib.h:
hi. i am using ubuntu 12.04 and trying to install NS2.35
for that matter i downloaded ns-allinone-2.35, unzipped it, started installation, the installation went well until it gave an error message and stopped. the error message is as follows:: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [tk3d.o] Error 1
tk8.5.10 make failed! Exiting …I’m pretty sure that I do have Xlib.h at the right place. i also tried to do this ‘sudo apt-get install libx11-dev’ but it returned me the following:
«Package libx11-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another sourceE: Package ‘libx11-dev’ has no installation candidate
«
in desperate search to an immediate solution.
-
Re: fatal error: X11/Xlib.h:
-
Re: fatal error: X11/Xlib.h:
Is this what you are looking for?:
https://launchpad.net/ubuntu/precise/amd64/libx11-6
If that’s not it then just do a search for libx11 or x11 in your package manager.
-
Re: fatal error: X11/Xlib.h:
while installing, tcl was installed successfully, but when it came to tk, it gave the following messages:
================================================== ==========
* Build Tk8.5.10
================================================== ==========
rm -f *.a *.o libtk* core errs *~ #* TAGS *.E a.out
errors wish tktest lib.exp Tk *.rsrc
rm -rf Makefile config.status config.cache config.log tkConfig.sh
SCRPtk.* prototype tkConfig.h *.plist Tk.framework
./install: 439: ./install: autoconf: not found
checking for Tcl configuration… found /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix/tclConfig.sh
checking for existence of /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix/tclConfig.sh… loading
checking for tclsh… /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/bin/tclsh8.5
checking for tclsh in Tcl build directory… /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix/tclsh
checking whether to use symlinks for manpages… no
checking whether to compress the manpages… no
checking whether to add a package name suffix for the manpages… no
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ANSI C… none needed
checking how to run the C preprocessor… gcc -E
checking for egrep… grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking limits.h usability… yes
checking limits.h presence… yes
checking for limits.h… yes
checking for stdlib.h… (cached) yes
checking if the compiler understands -pipe… yes
checking for building with threads… no (default)
checking how to build libraries… static
checking for ranlib… ranlib
checking if 64bit support is requested… no
checking if 64bit Sparc VIS support is requested… no
checking if compiler supports visibility «hidden»… yes
checking if rpath support is requested… yes
checking system version… Linux-3.2.0-26-generic
checking for dlopen in -ldl… yes
checking for ar… ar
checking for build with symbols… no
checking for required early compiler flags… _LARGEFILE64_SOURCE
checking for 64-bit integer type… using long
checking whether byte ordering is bigendian… no
checking for fd_set in sys/types… yes
checking sys/time.h usability… yes
checking sys/time.h presence… yes
checking for sys/time.h… yes
checking whether time.h and sys/time.h may both be included… yes
checking for strtod… yes
checking for Solaris2.4/Tru64 strtod bugs… ok
checking for mode_t… yes
checking for pid_t… yes
checking for size_t… yes
checking for uid_t in sys/types.h… yes
checking for intptr_t… yes
checking for uintptr_t… yes
checking pw_gecos in struct pwd… yes
checking for X… no
checking for X11 header files… couldn’t find any!
checking for X11 libraries… checking for XCreateWindow in -lXwindow… no
could not find any! Using -lX11.
checking for main in -lXbsd… no
checking whether to try to use XScreenSaver… no
checking whether to use xft… no
checking whether char is unsigned… no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tkConfig.sh
gcc -c -O2 -pipe -Wall -fPIC -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../unix -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../bitmaps -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/generic -I/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tcl8.5.10/unix -DPACKAGE_NAME=»tk» -DPACKAGE_TARNAME=»tk» -DPACKAGE_VERSION=»8.5″ -DPACKAGE_STRING=»tk 8.5″ -DPACKAGE_BUGREPORT=»» -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DSTATIC_BUILD=1 -DMODULE_SCOPE=extern __attribute__((__visibility__(«hidden»))) -DTCL_SHLIB_EXT=».so» -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_PW_GECOS=1 -DTCL_NO_DEPRECATED /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tk3d.c
In file included from /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tkInt.h:19:0,
from /home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tk3d.c:14:
/home/ahsen/.local/share/Trash/files/ns-allinone-2.3.35/tk8.5.10/unix/../generic/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [tk3d.o] Error 1
tk8.5.10 make failed! Exiting …one more thing is that while doing ‘sudo apt-get update’ it gives me the failure installing packages of X because of unreachable site, it gives me Err http://linux.ntuoss.org precise/universe amd64 Packages
@dodo3773! may be what you suggested is the right place from where i can get amd updation, but i really have no idea about how to do it. need help
keeping in mind that m using 64bit machine.
-
Re: fatal error: X11/Xlib.h:
Go into your package manager to install the packages you need. Should be called «Software Center» or something similar. Search for it.
-
Re: fatal error: X11/Xlib.h:
hi tried installing ns-2 2.35 in ubuntu 12.04 n i got the following error..
Kindly help me ….
TR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 /home/msit123/ns-allinone-2.35/tcl8.5.10/unix/../unix/tclAppInit.c
gcc -O2 -pipe -Wl,—export-dynamic tclAppInit.o -L/home/msit123/ns-allinone-2.35/tcl8.5.10/unix -ltcl8.5 -ldl -lieee -lm
-Wl,-rpath,/home/msit123/ns-allinone-2.35/lib -o tclsh
tcl8.5.10 make succeeded.
Installing libtcl8.5.a to /home/msit123/ns-allinone-2.35/lib/
cp: cannot create regular file `/home/msit123/ns-allinone-2.35/lib/#inst.14705#’: Permission denied
rm: cannot remove `/home/msit123/ns-allinone-2.35/lib/libtcl8.5.a’: Permission denied
mv: cannot stat `/home/msit123/ns-allinone-2.35/lib/#inst.14705#’: No such file or directory
ranlib: could not create temporary file whilst writing archive: No more archived files
make: *** [install-binaries] Error 1
tcl8.5.10 installation failed.
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.
msit123@msit123-Studio-1435:~/ns-allinone-2.35$
-
Re: fatal error: X11/Xlib.h:
Check the file permissions and the ownership.
Code:
namei -l /home/msit123/ns-allinone-2.35/lib
PS.
Please start your own thread. Your problem has nothing to do with that of the OP.
Bookmarks
Bookmarks

Posting Permissions
-
#1
I’m trying to compile a little program (xkblayout-state) which display the keyboard layout but for some reason it failed to compile because Xlib.h is missing but the library is on my sistem. Why I need this program? Because I have four layouts and sometimes it’s difficult to navigate without knowing which layout is active.
Also my knowledge of C++ are at basic level so any suggestion on how to compile this program is more then welcome! Thank you!
Code:
$gmake
c++ -O2 -Wall -c -o XKeyboard.o XKeyboard.cpp
In file included from XKeyboard.cpp:14:
./XKeyboard.h:20:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
^~~~~~~~~~~~
1 error generated.
gmake: *** [Makefile:13: XKeyboard.o] Error 1
Code:
$locate Xlib.h
/usr/local/include/X11/Xlib.h
-
#2
Add this to the CXXFLAGS line in the Makefile
This tells c++ to look under /usr/local/include when it is trying to find X11/Xlib.h.
-
Thread Starter
-
#3
O.K., that tip helped but it still fails to build. Invoking gmake -v tells me the gmake version.
Code:
gmake
c++ -O2 -Wall -c -o XKeyboard.o XKeyboard.cpp -I/usr/local/include
c++ -O2 -Wall -c -o wrapper.o wrapper.cpp -I/usr/local/include
c++ -O2 -o xkblayout-state XKeyboard.o wrapper.o -I/usr/local/include
XKeyboard.o: In function `XKeyboard::XKeyboard()':
XKeyboard.cpp:(.text+0x55): undefined reference to `XkbIgnoreExtension'
XKeyboard.cpp:(.text+0x8f): undefined reference to `XkbOpenDisplay'
XKeyboard.cpp:(.text+0xcc): undefined reference to `XkbSelectEventDetails'
XKeyboard.cpp:(.text+0xde): undefined reference to `XkbGetState'
XKeyboard.cpp:(.text+0xfc): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::initializeXkb()':
XKeyboard.cpp:(.text+0x5cc): undefined reference to `XkbQueryExtension'
XKeyboard.cpp:(.text+0x5d1): undefined reference to `XkbAllocKeyboard'
XKeyboard.cpp:(.text+0x5fb): undefined reference to `XkbGetControls'
XKeyboard.cpp:(.text+0x60b): undefined reference to `XkbGetNames'
XKeyboard.cpp:(.text+0x61b): undefined reference to `XkbGetNames'
XKeyboard.cpp:(.text+0x7cc): undefined reference to `XGetAtomName'
XKeyboard.cpp:(.text+0x8d4): undefined reference to `XFree'
XKeyboard.cpp:(.text+0x923): undefined reference to `XGetAtomName'
XKeyboard.cpp:(.text+0x93a): undefined reference to `XFree'
XKeyboard.cpp:(.text+0xc6a): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::accomodateGroupXkb()':
XKeyboard.cpp:(.text+0xe97): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::~XKeyboard()':
XKeyboard.cpp:(.text+0x18c1): undefined reference to `XCloseDisplay'
XKeyboard.o: In function `XKeyboard::currentGroupNum() const':
XKeyboard.cpp:(.text+0x1b26): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::currentGroupName() const':
XKeyboard.cpp:(.text+0x1b5c): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::currentGroupSymbol() const':
XKeyboard.cpp:(.text+0x1bac): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::currentGroupVariant() const':
XKeyboard.cpp:(.text+0x1bfc): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::setGroupByNum(int)':
XKeyboard.cpp:(.text+0x1c4d): undefined reference to `XkbLockGroup'
XKeyboard.cpp:(.text+0x1c60): undefined reference to `XkbGetState'
XKeyboard.o: In function `XKeyboard::changeGroup(int)':
XKeyboard.cpp:(.text+0x1c9e): undefined reference to `XkbLockGroup'
XKeyboard.cpp:(.text+0x1cb1): undefined reference to `XkbGetState'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:16: xkblayout-state] Error 1
Anyway I’ve solved my problem with the help of
x11/xkb-switch
and sh scripting. I’m guessing the next step it’s to mark the thread: solved or since the initial problem is not solved, xkblayout-state build fails the thread should remain open?
-
#4
If you have to use the -I switch in your make file to find the header files while compiling, you probably also have to use the -L switch to find link libraries while linking. Most likely simply adding «-L /usr/local/lib» will already be sufficient. But you really need to understand how make files work, how the -I and -L switches work, and that the layout (install location) of header files and link libraries can be different on different OSes. You should probably start by looking where the X11 installation lives on your computer.
I think since the second problem is a direct followup to the first one, using the same thread is a space-saving measure.


