Не удалось установить Otcl-1.14 для NS-2

Я пытаюсь установить NS-2 на Mac OS X 10.9.x Mavericks с ns-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

2 ответа

В каталоге otcl в файле конфигурации exe измените это

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

к этому

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

Я нашел это CF в _CF* все это означает CoreFoundation Framework (может быть частью XCode), и установщик не распознает его.

Таким образом, я положил -framework CoreFoundation в $CFLAGS в Makefile

Если вы бежите ./configure до make, Makefile будет изменено, и ваша модификация будет потеряна. В этом случае замените CFLAGS="-g -O2" с CFLAGS="-g -O2 -framework CoreFoundation" в ./configure

Другие вопросы по тегам