"Can't open X library" error while installing ns-2.26 in fc9
Linux - SoftwareThis 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.
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.
"Can't open X library" error while installing ns-2.26 in fc9
'./install' and './configure' are issuing the error:
Quote:
...
tclcl-1.0b13 has been installed successfully.
============================================================
* Build ns-2.26
============================================================
loading cache ./config.cache
...
checking for tcl2c++... ../tclcl-1.0b13
checking for X11 header files
checking for X11 library archive
checking for XOpenDisplay in -lX11... (cached) no
can't find X library
Ns configuration failed! Exiting ...
Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.
All the necessary packages are installed:
Quote:
already installed and latest version
Nothing to do message comes if I
'yum install libXmu-devel' for example
Also note:
Quote:
[root@localhost ~]# gcc --version
gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
My system is Fedora 9. I know that latest version of ns2 is 2.34 but for aodv-uu and mobile IP (http://core.it.uu.se/core/index.php/...le_IP_for_ns-2) I have to use ns2.26. That's why I have to install this version. Kindly also note that before 'Can't open X library' I got this error :
Quote:
...
tclcl-mappings.h:52: error: invalid use of incomplete type ‘struct Tcl’
tclcl-mappings.h:41: error: forward declaration of ‘struct Tcl’
...
Tcl.cc:603: warning: deprecated conversion from string constant to ‘char*’
make: *** [Tcl.o] Error 1
tclcl-1.0b13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
...
you do not have the -devel rpm's installed .Seeing as fedora 9 is now UNSUPPORTED and the repos have been moved to the historical archives since fedora 10 hit it's end of life
install the current and supported version
Fedora 12
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
@ John VV : The "yum install" line is only for the
sake of completeness : The OP installed ns-2.34 on
Fedora 9 fifty days ago.
So the -devel files are probably in place.
All Fedora 9 repo's still work. The repo had some
time ago these files added automagically :
'fedora.repo.rpmnew', 'fedora-updates-newkey.repo',
'fedora-updates-testing-newkey.repo'.
Seems to be a new feature, Fedora 9 only , so far. ?
.....
Total download size: 4.0 M
Is this ok [y/N]: y
Downloading Packages:
compat-gcc-34-3.4.6-9.i386.rpm | 4.0 MB 00:40
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : compat-gcc-34 1/1
Installed:
compat-gcc-34.i386 0:3.4.6-9
Complete!
[root@localhost ns-Installation]# yum install compat-gcc-34-c++
Loaded plugins: refresh-packagekit
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package compat-gcc-34-c++.i386 0:3.4.6-9 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================== ==========================================================
Package Arch Version Repository Size
==================================================================================================== ==========================================================
Installing:
compat-gcc-34-c++ i386 3.4.6-9 fedora 11 M
Total download size: 11 M
Is this ok [y/N]: y
Downloading Packages:
compat-gcc-34-c++-3.4.6-9.i386.rpm | 11 MB 01:45
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : compat-gcc-34-c++ 1/1
Installed:
compat-gcc-34-c++.i386 0:3.4.6-9
Complete!
Even now, at
Quote:
CXX=g++34 ./install
I get:
Quote:
...
checking for X11 library archive
checking for XOpenDisplay in -lX11... (cached) no
can't find X library
Ns configuration failed! Exiting ...
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Fedora 9 ... ns 2.26 ..
'libX11' error ? ? I get no errors like that.
And isn't ' tk8.3.2' using libX11 too ?
May be show the output of the command
' file /usr/lib/libX11.so '
.....
.....
I can get ns-2.26 compiled some of the way with g++34. EDIT, please see post # 22.
But the final result : I used g++-2.95 on Debian Etch.
May be it can be compiled on CentOS 3.9 too → g++296 .
Ns-2.xx is only creating one file = ' ns '.
You can get a copy of my binary 'ns' :
Click my name and send an email.
.....
And 'nam' : You can use the nam binary from ns-allinone-2.34 .
.. Can be used as /usr/local/bin/nam .
.....
Thanks knudfl
Friends please notice one more thing:
Before applying the patch (mentioned in my first post):
Quote:
[mq15@localhost ns-allinone-2.26]$ ./install
...
otcl-1.0a8 has been installed successfully.
============================================================
* Build Tclcl-1.0b13
============================================================
No .configure file found in current directory
Continuing with default options...
checking for X11 library archive
checking for XOpenDisplay in -lX11... yes
checking for XShmAttach in -lXext... yes
No explicit static compilation flag; setting V_STATIC to ""
checking for dlopen in -ldl... yes
...
tclcl-mappings.h: In static member function ‘static int TclObjectHelper<T>::dispatch_(void*, Tcl_Interp*, int, char**)’:
tclcl-mappings.h:51: error: incomplete type ‘Tcl’ used in nested name specifier
tclcl-mappings.h:52: error: invalid use of incomplete type ‘struct Tcl’
tclcl-mappings.h:41: error: forward declaration of ‘struct Tcl’
tclcl-mappings.h:57: error: invalid use of incomplete type ‘struct Tcl’
tclcl-mappings.h:41: error: forward declaration of ‘struct Tcl’
Tcl.cc: In member function ‘void Tcl::eval(char*)’:
Tcl.cc:180: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In member function ‘int TclObject::traceVar(const char*, TclObject*)’:
Tcl.cc:419: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In static member function ‘static int TclClass::create_shadow(void*, Tcl_Interp*, int, char**)’:
Tcl.cc:507: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc:509: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In static member function ‘static int TclClass::dispatch_instvar(void*, Tcl_Interp*, int, char**)’:
Tcl.cc:569: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc: In member function ‘virtual void TclClass::bind()’:
Tcl.cc:601: warning: deprecated conversion from string constant to ‘char*’
Tcl.cc:603: warning: deprecated conversion from string constant to ‘char*’
make: *** [Tcl.o] Error 1
tclcl-1.0b13 make failed! Exiting ...
After applying the patch:
Quote:
tclcl-1.0b13 has been installed successfully.
============================================================
* Build ns-2.26
============================================================
loading cache ./config.cache
No .configure file found in current directory
Continuing with default options...
...
checking for X11 header files
checking for X11 library archive
checking for XOpenDisplay in -lX11... (cached) no
can't find X library
Ns configuration failed! Exiting ...
Please note the difference. I have also installed compat-gcc-34 but I think ns is being compiled by gcc4.3 as:
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Quote:
tclcl-1.0b13 make failed! Exiting ...
tclcl-1.0b13 :
No errors on my Fedora 9 using gcc / g++ version 4.3.0.
.....
Quote:
can't find X library
Ns configuration failed! Exiting ...
I do not get that error either, see post # 7.
Something is wrong with your Fedora 9, or you have
a corrupted ns-allinone-2.26 .
Ns-2.26 can not be compiled on Fedora 9. See post # 7. EDIT, please see post # 22.
Ns-allinone-2.26 was made for Redhat 9 , it seems.
A long term version of Redhat 9 is CentOS 3.9 (Redhat EL 3.9).
CentOS 3.9 : Creates a perfect ns-2.26, see post # 9. EDIT, see post # 22.
.....
.....
If you want to be absolute sure, that ns-2.26 uses g++34 :
Edit Makefile.in, line 36-37 from
Code:
CC = @CC@
CPP = @CXX@
to
CC = gcc34
CPP = g++34
.....
The patch, "ns-2.26-aodv-uu-mip" which isn't a patch,
but a patched version of ns-2.26 meant to replace
ns-allinone-2.26/ns-2.26 :
Using g++34 it stops with the same errors as 2.26-orig :
Code:
webcache/webtraf.cc: In member function `virtual int WebTrafPool::command(int, const char* const*)':
webcache/webtraf.cc:415: fejl: ISO C++ forbids ....
make: *** [webcache/webtraf.o] Error 1
I will see, what I can do about it on CentOS 3.9.
.....
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
My "CentOS 3.9" computer has been down for a couple of days.
I got a new 'CentOS 3.9' up running today, and ns-allinone-2.26
with the modified 'ns-2.26' = 'ns-2.26-aodv-uu-mip' compiled OK.
I will send you an email with the resultant binaries attached :
'ns' and 'nse'.
.....
EDIT
P.S. : May be I have to redo, so you can use it with the new
dependency = libpcap.so.Xx
( CentOS39 libpcap.so.0.6.2 , Fedora 9 libpcap.so.0.9 ).
.....
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Using 'ns' : just like you would do, if you had compiled
the application yourself .. or unpacked it as a binary
application.
The binaries have their location in ns-allinone-2.26/ns-2.26/
If any doubt : look at the ns-allinone-2.34, you have.
No difference. Example command : 'ns file.tcl' ( like 2.34 ).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.