1

我正在尝试在 Mac OS X 10.9.x Mavericks 上安装 NS-2ns-allinone

每次我运行安装脚本时,它都会在安装 Otcl 的步骤中失败,并出现以下错误:

rm -f libotcl otcl.o so_locations
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -DHAVE_UNISTD_H=1 -fPIC -I. -I/Users/songsong/Downloads/ns-allinone-2.35/include -I/Users/songsong/Downloads/ns-allinone-2.35/include -I/Users/songsong/Downloads/ns-allinone-2.35/include -I/usr/X11R6/include -I/include  otcl.c
otcl.c:784:14: warning: cast to 'Proc *' (aka 'struct Proc *') from smaller
      integer type 'int' [-Wint-to-pointer-cast]
      return Tcl_CmdInfoGetProc(co);
             ^
otcl.c:74:32: note: expanded from macro 'Tcl_CmdInfoGetProc'
#define Tcl_CmdInfoGetProc(co) (Proc *)(co->isNativeObjectProc) ? co->ob...
                               ^
1 warning generated.
o libotcl otcl.o
make: o: No such file or directory
make: [libotcl] Error 1 (ignored)
rm -f libotcl
gcc -o otclsh  -g -O2 -I. -I/Users/songsong/Downloads/ns-allinone-2.35/include -I/Users/songsong/Downloads/ns-allinone-2.35/include -I/Users/songsong/Downloads/ns-allinone-2.35/include -I/usr/X11R6/include -I/include  otclAppInit.c \
    -L. -lotcl -L/Users/songsong/Downloads/ns-allinone-2.35/lib -ltk8.5 -L/Users/songsong/Downloads/ns-allinone-2.35/lib -ltcl8.5 -L/usr/X11R6/lib -lXext -lX11  -lm
Undefined symbols for architecture x86_64:
  "_CFAbsoluteTimeGetCurrent", referenced from:
      _Tcl_SetTimer in libtcl8.5.a(tclMacOSXNotify.o)
      _Tcl_ServiceModeHook in libtcl8.5.a(tclMacOSXNotify.o)
      _Tcl_Sleep in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFBundleCopyBundleURL", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFBundleCopyResourceURL", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFBundleCreate", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFBundleGetBundleWithIdentifier", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFLocaleCopyCurrent", referenced from:
      _TclpSetVariables in libtcl8.5.a(tclUnixInit.o)
  "_CFLocaleGetIdentifier", referenced from:
      _TclpSetVariables in libtcl8.5.a(tclUnixInit.o)
  "_CFRelease", referenced from:
      _Tcl_FinalizeNotifier in libtcl8.5.a(tclMacOSXNotify.o)
      _TclpSetVariables in libtcl8.5.a(tclUnixInit.o)
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFRunLoopAddObserver", referenced from:
      _Tcl_InitNotifier in libtcl8.5.a(tclMacOSXNotify.o)
      _TclMacOSXNotifierAddRunLoopMode in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopAddSource", referenced from:
      _Tcl_InitNotifier in libtcl8.5.a(tclMacOSXNotify.o)
      _TclMacOSXNotifierAddRunLoopMode in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopAddTimer", referenced from:
      _TclMacOSXNotifierAddRunLoopMode in libtcl8.5.a(tclMacOSXNotify.o)
      _Tcl_ServiceModeHook in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopGetCurrent", referenced from:
      _Tcl_InitNotifier in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopObserverCreate", referenced from:
      _Tcl_InitNotifier in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopObserverInvalidate", referenced from:
      _Tcl_FinalizeNotifier in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopRunInMode", referenced from:
      _Tcl_WaitForEvent in libtcl8.5.a(tclMacOSXNotify.o)
      _Tcl_Sleep in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopSourceCreate", referenced from:
      _Tcl_InitNotifier in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopSourceInvalidate", referenced from:
      _Tcl_FinalizeNotifier in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopSourceSignal", referenced from:
      _Tcl_AlertNotifier in libtcl8.5.a(tclMacOSXNotify.o)
      _NotifierThreadProc in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopTimerCreate", referenced from:
      _Tcl_ServiceModeHook in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopTimerGetNextFireDate", referenced from:
      _Tcl_Sleep in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopTimerInvalidate", referenced from:
      _Tcl_FinalizeNotifier in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopTimerSetNextFireDate", referenced from:
      _Tcl_SetTimer in libtcl8.5.a(tclMacOSXNotify.o)
      _Tcl_Sleep in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFRunLoopWakeUp", referenced from:
      _Tcl_AlertNotifier in libtcl8.5.a(tclMacOSXNotify.o)
      _NotifierThreadProc in libtcl8.5.a(tclMacOSXNotify.o)
  "_CFStringCompare", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFStringCreateWithCString", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFStringGetCString", referenced from:
      _TclpSetVariables in libtcl8.5.a(tclUnixInit.o)
  "_CFURLCopyLastPathComponent", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFURLCreateCopyAppendingPathComponent", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "_CFURLGetFileSystemRepresentation", referenced from:
      _Tcl_MacOSXOpenVersionedBundleResources in libtcl8.5.a(tclMacOSXBundle.o)
  "___CFConstantStringClassReference", referenced from:
      CFString in libtcl8.5.a(tclMacOSXNotify.o)
      CFString in libtcl8.5.a(tclMacOSXBundle.o)
      CFString in libtcl8.5.a(tclMacOSXBundle.o)
  "_kCFRunLoopCommonModes", referenced from:
      _Tcl_InitNotifier in libtcl8.5.a(tclMacOSXNotify.o)
      _Tcl_ServiceModeHook in libtcl8.5.a(tclMacOSXNotify.o)
  "_kCFRunLoopDefaultMode", referenced from:
      _Tcl_WaitForEvent in libtcl8.5.a(tclMacOSXNotify.o)
      _Tcl_Sleep in libtcl8.5.a(tclMacOSXNotify.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [otclsh] Error 1
4

2 回答 2

2

我发现事情确实意味着CFCoreFoundation _CF*Framework(可能是Xcode的一部分)并且安装程序无法识别它。

因此,我-framework CoreFoundation投入$CFLAGSMakefile

如果你./configure之前运行make,Makefile将会被修改并且你的修改将会丢失。在这种情况下,替换CFLAGS="-g -O2"CFLAGS="-g -O2 -framework CoreFoundation"in./configure

于 2014-01-15T04:27:06.170 回答
2

在configure exe文件中的otcl目录中更改此

if test "$GCC" = yes; then CFLAGS="-g -O2"

对此

if test "$GCC" = yes; then CFLAGS="-g -O2 -framework CoreFoundation"
于 2016-10-03T18:25:04.280 回答