cygwin startxwin.bat 提示找不到路径

来源:互联网 发布:崔走召的网络电影 编辑:程序博客网 时间:2024/06/05 10:05
如果在cygwin中使用命令 startxwin.bat使提示以下错误:
 
startxwin.bat - Starting on Windows NT/2000/XP/2003
The system cannot find the path specified.
The system cannot find the path specified.
 
 
一个很可能的错误是startxwin.bat本身的路径。由于cygwin是默认安装在c:/cygwin,或者至少是其他分区的根目录下,所以一旦用户将cygwin安装在了某个子目录中,则会出现以上错误。解决办法:
 
用ultraEdit或其他编译器打开cygwin/bin/startxwin.bat,在设置 CYGWIN_ROOT=\cygwin这一行,在\cygwin前面加上子目录路径,注意不要加盘符。举例:我的cygwin装在了f:\study\hkust\tools\cygwin下,则将上述位置修改为 CYGWIN_ROOT=\study\hkust\tools\cygwin
 
保存并退出编译器。
 
在cygwin中运行 startxwin.bat,应该不会再出现上述错误。
 
另:ns2安装完毕后除了网上所说的一些环境变量的添加(修改.bashrc或者/etc/bash.bashrc均可,注意修改完后要运行一下source /etc/bash.bashrc才起作用,或者关闭cygwin重开),还要将ns-allinone-2.xx/nam1.xx也添加到path中,否则可能出现找不到nam.exe的错误;
 
如运行startxwin.bat是正常出现 xwin,但在xwin中运行 ns ns-2.29/ns-tutorial/examples/example2.tcl时出现:
 
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" [tk windowingsystem] eq "aqua"} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."
是由于tk8.1x和ns不匹配。解决办法为:
 
1. 找到 并用ultraEdit打开 ns-allinone.2.xx\tk8.1x\generic\tkBind.c;
 
2. 在588行左右找到: 
 0,
  VIRTUAL,

3. 在中间加入一行,使变为
0,
#ifdef GenericEvent
  0,
#endif 
VIRTUAL,
 
红色为新加入的。两行注释加不加均可。

 

4.cd至ns-allinone-2.xx,重新运行 ./install

 

5.问题应该能够解决

0 0