I'm trying to install NS-2 on Mac OS X 10.9.x Mavericks with ns-allinone
Everytime I run the install script, it fails in a step installing Otcl with the errors:
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
I found that CF in _CF* things does mean CoreFoundation Framework (might be a part of Xcode)
And the installer doesn't recognize it.
Thus, I put -framework CoreFoundation to $CFLAGS in Makefile
If you run ./configure before make, Makefile will be modified and your modification will be lost. In that case, replace CFLAGS="-g -O2" with CFLAGS="-g -O2 -framework CoreFoundation" in ./configure
In the otcl directory in the configure exe file change this
if test "$GCC" = yes; then CFLAGS="-g -O2"
to this
if test "$GCC" = yes; then CFLAGS="-g -O2 -framework CoreFoundation"
Related
I am trying to switch to CLion IDE in my Mac. My CMakeLists.txt works but while building the project, I get linker command failed error. I first tried with FindSDL2 and FindSDL2_IMAGE, but I removed it because I got the same error both with and without. I have a doubt about the SDL_LIBRARY and SDL2_IMAGE_LIBRARY, where it is declared?.
CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(OxEngine)
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES main.cpp engine.cpp sprite.cpp classes.h inventory.cpp vector.cpp)
MESSAGE(${SDL_INCLUDE_DIR} " Image: " ${SDL2_IMAGE_INCLUDE_DIR})
include_directories(${SDL_INCLUDE_DIR})
include_directories(${SDL2_IMAGE_INCLUDE_DIR})
add_executable(${CMAKE_PROJECT_NAME} ${SOURCE_FILES})
MESSAGE(${SDL_LIBRARY} " HH " ${SDL2_IMAGE_LIBRARY})
target_link_libraries(${CMAKE_PROJECT_NAME} ${SDL_LIBRARY} ${SDL2_IMAGE_LIBRARY})
When loaded in CLion I get the following CMake output:
"/Applications/CLion 2.app/Contents/bin/cmake/mac/bin/cmake" -DCMAKE_BUILD_TYPE= -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G "CodeBlocks - Unix Makefiles" /Users/nantha/Projc/my_projects/OxEngine/src
/Library/Frameworks/SDL2.framework/Headers Image: /usr/local/include/SDL2
/usr/local/lib/libSDL.dylib-framework Cocoa HH /usr/local/lib/libSDL2_image.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/nantha/Projc/my_projects/OxEngine/src/cmake-build-runit
[Finished]
When I run the project I get
====================[ Build | OxEngine | Runit ]================================
"/Applications/CLion 2.app/Contents/bin/cmake/mac/bin/cmake" --build /Users/nantha/Projc/my_projects/OxEngine/src/cmake-build-runit --target OxEngine -- -lSDL2 -lSDL2_image
[ 16%] Linking CXX executable OxEngine
Undefined symbols for architecture x86_64:
"_SDL_CreateRenderer", referenced from:
Engine::init(Game&) in engine.cpp.o
"_SDL_CreateTexture", referenced from:
Inventory::render_itemButtons() in inventory.cpp.o
Inventory::render_categoryButtons() in inventory.cpp.o
Inventory::draw() in inventory.cpp.o
"_SDL_CreateTextureFromSurface", referenced from:
Engine::loadMedia() in engine.cpp.o
Button::load_images() in engine.cpp.o
Sprite::load_images() in sprite.cpp.o
InventoryButton::load_icon() in inventory.cpp.o
"_SDL_CreateWindow", referenced from:
Engine::init(Game&) in engine.cpp.o
"_SDL_DestroyRenderer", referenced from:
Engine::close() in engine.cpp.o
"_SDL_DestroyTexture", referenced from:
Inventory::draw() in inventory.cpp.o
"_SDL_DestroyWindow", referenced from:
Engine::close() in engine.cpp.o
"_SDL_QueryTexture", referenced from:
Inventory::draw() in inventory.cpp.o
"_SDL_RenderClear", referenced from:
Engine::drawisoworld() in engine.cpp.o
"_SDL_RenderCopy", referenced from:
Engine::renderit(std::__1::vector<std::__1::vector<bool, std::__1::allocator<bool> >, std::__1::allocator<std::__1::vector<bool, std::__1::allocator<bool> > > >&, int, int, int) in engine.cpp.o
Engine::draw_selected_tiles() in engine.cpp.o
Button::drawButton() in engine.cpp.o
Engine::drawisoworld() in engine.cpp.o
InventoryButton::draw() in inventory.cpp.o
Inventory::draw() in inventory.cpp.o
"_SDL_RenderFillRect", referenced from:
Inventory::render_itemButtons() in inventory.cpp.o
Inventory::render_categoryButtons() in inventory.cpp.o
Inventory::draw() in inventory.cpp.o
"_SDL_RenderPresent", referenced from:
Engine::update() in engine.cpp.o
"_SDL_SetRenderDrawColor", referenced from:
Engine::loadMedia() in engine.cpp.o
Engine::drawisoworld() in engine.cpp.o
Inventory::render_itemButtons() in inventory.cpp.o
Inventory::render_categoryButtons() in inventory.cpp.o
Inventory::draw() in inventory.cpp.o
"_SDL_SetRenderTarget", referenced from:
Inventory::render_itemButtons() in inventory.cpp.o
Inventory::render_categoryButtons() in inventory.cpp.o
Inventory::draw() in inventory.cpp.o
"_SDL_SetTextureBlendMode", referenced from:
Inventory::draw() in inventory.cpp.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[3]: *** [OxEngine] Error 1
make[2]: *** [CMakeFiles/OxEngine.dir/all] Error 2
make[1]: *** [CMakeFiles/OxEngine.dir/rule] Error 2
make: *** [OxEngine] Error 2
Project Structure:
Thank You
I am tryting to install Kaldi, for which I installed relevant things (such as gcc, automakers, autoconf, etc...).
However, because of compiling errors, I could not go further...
The error message was as follows...
(base) C-MacBook-Pro:tools ninackjeong$ extras/check_dependencies.sh
extras/check_dependencies.sh: all OK.
(base) C-MacBook-Pro:tools ninackjeong$ make -j 6
extras/check_dependencies.sh
cd sph2pipe_v2.5/ && \
x86_64-apple-darwin13.4.0-clang -o sph2pipe *.c -lm
if [ -d "" ]; then \
cp -p "/cub-1.8.0.zip" .; \
else \
wget -T 10 -t 3 -O cub-1.8.0.zip https://github.com/NVlabs/cub/archive/1.8.0.zip; \
fi
--2020-02-03 09:44:29-- https://github.com/NVlabs/cub/archive/1.8.0.zip
Resolving github.com (github.com)... extras/check_dependencies.sh: all OK.
tar xojf sctk-2.4.10-20151007-1312Z.tar.bz2 || \
tar --exclude '*NONE*html' -xvojf sctk-2.4.10-20151007-1312Z.tar.bz2
cd openfst-1.6.7/ && \
./configure --prefix=`pwd` --enable-static --enable-shared --enable-far --enable-ngram-fsts CXX="x86_64-apple-darwin13.4.0-clang++" CXXFLAGS="-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 " LDFLAGS="-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs" LIBS="-ldl"
192.30.255.112
Connecting to github.com (github.com)|192.30.255.112|:443... file_headers.c:149:24: warning: format specifies type 'int' but the argument has type 'off_t' (aka 'long long') [-Wformat]
inpname, sampcount, statbuf.st_size );
^~~~~~~~~~~~~~~
file_headers.c:579:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
ConvertToIeeeExtended(num, bytes)
^
file_headers.c:629:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
3 warnings generated.
connected.
shorten_x.c:187:29: warning: too many arguments in call to 'word_get'
gbuffer = word_get(fpin);
~~~~~~~~ ^
shorten_x.c:325:22: warning: implicit declaration of function 'pcm2alaw' is invalid in C99 [-Wimplicit-function-declaration]
*writebufp++ = pcm2alaw( ulaw2pcm[data0[i]] );
^
shorten_x.c:381:24: warning: implicit declaration of function 'pcm2ulaw' is invalid in C99 [-Wimplicit-function-declaration]
*writebufp++ = pcm2ulaw( data0[i] );
^
HTTP request sent, awaiting response... 3 warnings generated.
sph2pipe.c:191:18: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration]
while (( i = getopt( ac, av, "daupf:c:t:s:h:" )) != EOF )
^
sph2pipe.c:530:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:545:8: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:547:15: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
wptr = cptr = outbuf;
^ ~~~~~~
sph2pipe.c:547:8: warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
wptr = cptr = outbuf;
^ ~~~~~~~~~~~~~
sph2pipe.c:561:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:568:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:616:7: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
8 warnings generated.
ld: warning: ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd
ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture x86_64:
"___sprintf_chk", referenced from:
_writeSphHeader in file_headers-d8b2d2.o
"___stack_chk_fail", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
_writeAIFFHeader in file_headers-d8b2d2.o
"___stack_chk_guard", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
_writeAIFFHeader in file_headers-d8b2d2.o
"___stderrp", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
_writeAUHeader in file_headers-d8b2d2.o
_writeRIFFHeader in file_headers-d8b2d2.o
_writeAIFFHeader in file_headers-d8b2d2.o
_word_get in shorten_x-0926aa.o
_init_offset in shorten_x-0926aa.o
...
"___stdoutp", referenced from:
_doConversion in sph2pipe-035023.o
"___strncpy_chk", referenced from:
_writeSphHeader in file_headers-d8b2d2.o
"_exit", referenced from:
_writeSphHeader in file_headers-d8b2d2.o
_writeAUHeader in file_headers-d8b2d2.o
_writeRIFFHeader in file_headers-d8b2d2.o
_writeAIFFHeader in file_headers-d8b2d2.o
_fwrite_type in shorten_x-0926aa.o
_shortenXtract in shorten_x-0926aa.o
_main in sph2pipe-035023.o
...
"_fclose", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_doConversion in sph2pipe-035023.o
"_fileno", referenced from:
_readSphHeader in file_headers-d8b2d2.o
"_floor", referenced from:
_ConvertToIeeeExtended in file_headers-d8b2d2.o
"_fopen", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_doConversion in sph2pipe-035023.o
"_fprintf", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
_writeAUHeader in file_headers-d8b2d2.o
_writeRIFFHeader in file_headers-d8b2d2.o
_writeAIFFHeader in file_headers-d8b2d2.o
_word_get in shorten_x-0926aa.o
_init_offset in shorten_x-0926aa.o
...
"_fputs", referenced from:
_main in sph2pipe-035023.o
"_fread", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_word_get in shorten_x-0926aa.o
_copySamples in sph2pipe-035023.o
"_free", referenced from:
_fwrite_type in shorten_x-0926aa.o
"_frexp", referenced from:
_ConvertToIeeeExtended in file_headers-d8b2d2.o
"_fseek", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_copySamples in sph2pipe-035023.o
"_fstat$INODE64", referenced from:
_readSphHeader in file_headers-d8b2d2.o
"_fwrite", referenced from:
_writeSphHeader in file_headers-d8b2d2.o
_writeAUHeader in file_headers-d8b2d2.o
_writeRIFFHeader in file_headers-d8b2d2.o
_writeAIFFHeader in file_headers-d8b2d2.o
_fwrite_type in shorten_x-0926aa.o
_copySamples in sph2pipe-035023.o
(maybe you meant: _fwrite_type)
"_getc", referenced from:
_shortenXtract in shorten_x-0926aa.o
"_getopt", referenced from:
_getUserOpts in sph2pipe-035023.o
"_index", referenced from:
_getUserOpts in sph2pipe-035023.o
"_ldexp", referenced from:
_ConvertToIeeeExtended in file_headers-d8b2d2.o
"_malloc", referenced from:
_long2d in shorten_x-0926aa.o
_fwrite_type in shorten_x-0926aa.o
_shortenXtract in shorten_x-0926aa.o
_main in sph2pipe-035023.o
"_optarg", referenced from:
_getUserOpts in sph2pipe-035023.o
"_optind", referenced from:
_getUserOpts in sph2pipe-035023.o
"_putc", referenced from:
_shortenXtract in shorten_x-0926aa.o
"_sscanf", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
_getUserOpts in sph2pipe-035023.o
"_strcmp", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
_copylong in file_headers-d8b2d2.o
_copyshort in file_headers-d8b2d2.o
_fwrite_type in shorten_x-0926aa.o
_getUserOpts in sph2pipe-035023.o
_doConversion in sph2pipe-035023.o
...
"_strdup", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_getUserOpts in sph2pipe-035023.o
"_strlen", referenced from:
_readSphHeader in file_headers-d8b2d2.o
"_strncasecmp", referenced from:
_getUserOpts in sph2pipe-035023.o
"_strncmp", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
"_strtok", referenced from:
_readSphHeader in file_headers-d8b2d2.o
_writeSphHeader in file_headers-d8b2d2.o
"_swab", referenced from:
_copyshort in file_headers-d8b2d2.o
_fwrite_type in shorten_x-0926aa.o
_copySamples in sph2pipe-035023.o
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sph2pipe_v2.5/sph2pipe] Error 1
make: *** Waiting for unfinished jobs....
302 Found
Location: https://codeload.github.com/NVlabs/cub/zip/1.8.0 [following]
--2020-02-03 09:44:30-- https://codeload.github.com/NVlabs/cub/zip/1.8.0
Resolving codeload.github.com (codeload.github.com)... 192.30.255.121
Connecting to codeload.github.com (codeload.github.com)|192.30.255.121|:443... connected.
HTTP request sent, awaiting response... checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
200 OK
Length: 602396 (588K) [application/zip]
Saving to: ‘cub-1.8.0.zip’
cub-1.8.0.zip 0%[ ] 0 --.-KB/s checking for style of include used by make... GNU
checking for gcc... x86_64-apple-darwin13.4.0-clang
cub-1.8.0.zip 37%[======> ] 220.43K 1.07MB/s checking whether the C compiler works... no
configure: error: in `/Users/ninackjeong/kaldi/tools/openfst-1.6.7':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [openfst-1.6.7/Makefile] Error 77
cub-1.8.0.zip 100%[===================>] 588.28K 1.93MB/s in 0.3s
2020-02-03 09:44:30 (1.93 MB/s) - ‘cub-1.8.0.zip’ saved [602396/602396]
unzip -oq cub-1.8.0.zip
rm -f cub
ln -s cub-1.8.0 cub
rm -rf sctk && ln -s sctk-2.4.10 sctk
When I typed more specific command "make CXX=g++-4.8," the error message was follows. It seems that this needs g++ 4.8.3., Apple Xcode 5.0 or clang 3.3, but mine are gcc and gcc#4.9 (installed through brew) and my Xcode and clang are far beyond 5.0 and 3.3. If these are problems, I would like to ask how to install them (I tried to install g++ 4.8.3, but "gcc48" seems not to be provided on brew, and I could not find Xcode 5.0 installation file...).
I do apologize for any inconvenience, and I really appreciate all your time!
<< gcc -v check >>
(base) C-MacBook-Pro:~ ninackjeong$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
<< possible problems when the more specific command was put>>
(base) C-MacBook-Pro:tools ninackjeong$ make CXX=g++-4.8
extras/check_dependencies.sh
extras/check_dependencies.sh: Compiler 'g++-4.8' is not installed.
extras/check_dependencies.sh: You need g++ >= 4.8.3, Apple Xcode >= 5.0 or clang >= 3.3.
extras/check_dependencies.sh: The following prerequisites are missing; install them first:
g++
make: *** [check_required_programs] Error 1
i'm trying to do an iterative closest point but since I'm a noob I'm trying starting from this tutorial:
http://pointclouds.org/documentation/tutorials/iterative_closest_point.php
all required dependencies are installed, Operative System is MacOs High Sierra, I have this error when I execute make command :
Undefined symbols for architecture x86_64:
"pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::__1::vector<int, std::__1::allocator<int> > const> const&)", referenced from:
vtable for pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > in iterative_closest_point.cpp.o
"pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::radiusSearch(pcl::PointXYZ const&, double, std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<float, std::__1::allocator<float> >&, unsigned int) const", referenced from:
vtable for pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > in iterative_closest_point.cpp.o
"pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::nearestKSearch(pcl::PointXYZ const&, int, std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<float, std::__1::allocator<float> >&) const", referenced from:
vtable for pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > in iterative_closest_point.cpp.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[2]: *** [iterative_closest_point] Error 1
make[1]: *** [CMakeFiles/iterative_closest_point.dir/all] Error 2
make: *** [all] Error 2
I can not understand what I'm wrong
Here is my simple test code,
#include <iostream>
int main(){
std::cout << "SAO" << std::endl;
return 0;
}
and compile command below
gcc -o test test.cpp
and I am having a compile error below.
Undefined symbols for architecture x86_64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const", referenced from:
std::__verify_grouping(char const*, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in ccMFcxIz.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long) const", referenced from:
std::__verify_grouping(char const*, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in ccMFcxIz.o
"std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))", referenced from:
_main in ccMFcxIz.o
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccMFcxIz.o
"std::ios_base::Init::~Init()", referenced from:
___tcf_0 in ccMFcxIz.o
"std::cout", referenced from:
_main in ccMFcxIz.o
"std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)", referenced from:
_main in ccMFcxIz.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
_main in ccMFcxIz.o
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in ccMFcxIz.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
I've tried putting -m32 just in case but still give me error below.
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Version of gcc is 4.2 which is installed by XCode "command line tool".
OS is Mac OSX Mountain Lion.
I've tried with gcc 4.7 or clang 3.1 but same error..
Ofcourse, compiling cpp code with gcc will give you error. You should use g++
I used macports to download and install boost lib without any problems.
I tried to run the code from their website and got the following novel:
c++ -c -o Main.o Main.cpp
Compiling...
g++ -o VectorSjov Main.o utunity/math/vector/Vec2d.cpp
Undefined symbols for architecture x86_64:
"boost::serialization::void_upcast(boost::serialization::extended_type_info const&, boost::serialization::extended_type_info const&, void const*)", referenced from:
bus_stop* boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::pointer_tweak<bus_stop>(boost::serialization::extended_type_info const&, void const*, bus_stop const&)in Main.o
bus_route* boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::pointer_tweak<bus_route>(boost::serialization::extended_type_info const&, void const*, bus_route const&)in Main.o
"boost::serialization::typeid_system::extended_type_info_typeid_0::type_register(std::type_info const&)", referenced from:
boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_destination>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<gps_position>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_corner>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_route>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_schedule::trip_info>::extended_type_info_typeid()in Main.o
...
"boost::serialization::typeid_system::extended_type_info_typeid_0::type_unregister()", referenced from:
boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_destination>::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<gps_position>::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop>::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_corner>::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_route>::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_schedule::trip_info>::~extended_type_info_typeid()in Main.o
...
"boost::serialization::typeid_system::extended_type_info_typeid_0::extended_type_info_typeid_0(char const*)", referenced from:
boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_destination>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<gps_position>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_corner>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_route>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_schedule::trip_info>::extended_type_info_typeid()in Main.o
...
"boost::serialization::typeid_system::extended_type_info_typeid_0::~extended_type_info_typeid_0()", referenced from:
boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_destination>::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop_destination>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<gps_position>::~extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<gps_position>::extended_type_info_typeid()in Main.o
boost::serialization::extended_type_info_typeid<bus_stop>::~extended_type_info_typeid()in Main.o
...
"boost::serialization::void_downcast(boost::serialization::extended_type_info const&, boost::serialization::extended_type_info const&, void const*)", referenced from:
void boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::polymorphic::save<bus_stop>(boost::archive::text_oarchive&, bus_stop&)in Main.o
"boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)", referenced from:
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<unsigned int>(unsigned int&)in Main.o
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<boost::serialization::collection_size_type>(boost::serialization::collection_size_type&)in Main.o
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<float>(float&)in Main.o
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<int>(int&)in Main.o
void boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::polymorphic::save<bus_stop>(boost::archive::text_oarchive&, bus_stop&)in Main.o
void boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::save<unsigned int>(unsigned int const&)in Main.o
void boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::save<boost::serialization::collection_size_type>(boost::serialization::collection_size_type const&)in Main.o
...
"boost::archive::archive_exception::~archive_exception()", referenced from:
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<unsigned int>(unsigned int&)in Main.o
void boost::serialization::throw_exception<boost::archive::archive_exception>(boost::archive::archive_exception const&)in Main.o
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<boost::serialization::collection_size_type>(boost::serialization::collection_size_type&)in Main.o
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<float>(float&)in Main.o
void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<int>(int&)in Main.o
void boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::polymorphic::save<bus_stop>(boost::archive::text_oarchive&, bus_stop&)in Main.o
void boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::save<unsigned int>(unsigned int const&)in Main.o
...
"boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load_override(boost::archive::class_name_type&, int)", referenced from:
boost::archive::text_iarchive& boost::archive::detail::interface_iarchive<boost::archive::text_iarchive>::operator>><boost::archive::class_name_type>(boost::archive::class_name_type&)in Main.o
"boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)", referenced from:
void boost::archive::load_access::load_primitive<boost::archive::text_iarchive, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(boost::archive::text_iarchive&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in Main.o
"boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::text_iarchive_impl(std::basic_istream<char, std::char_traits<char> >&, unsigned int)", referenced from:
boost::archive::text_iarchive::text_iarchive(std::basic_istream<char, std::char_traits<char> >&, unsigned int)in Main.o
"boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
void boost::archive::save_access::save_primitive<boost::archive::text_oarchive, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(boost::archive::text_oarchive&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Main.o
....
bus_stop_corner>in Main.o
typeinfo for boost::archive::detail::oserializer<boost::archive::text_oarchive, bus_route>in Main.o
typeinfo for boost::archive::detail::oserializer<boost::archive::text_oarchive, bus_schedule::trip_info>in Main.o
...
"typeinfo for boost::archive::detail::basic_pointer_iserializer", referenced from:
typeinfo for boost::archive::detail::pointer_iserializer<boost::archive::text_iarchive, bus_route>in Main.o
typeinfo for boost::archive::detail::pointer_iserializer<boost::archive::text_iarchive, bus_stop_destination>in Main.o
typeinfo for boost::archive::detail::pointer_iserializer<boost::archive::text_iarchive, bus_stop_corner>in Main.o
"typeinfo for boost::archive::detail::basic_pointer_oserializer", referenced from:
typeinfo for boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, bus_route>in Main.o
typeinfo for boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, bus_stop_destination>in Main.o
typeinfo for boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, bus_stop_corner>in Main.o
"vtable for boost::archive::archive_exception", referenced from:
boost::archive::archive_exception::archive_exception(boost::archive::archive_exception const&)in Main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [VectorSjov] Error 1
[Finished in 3.1s with exit code 2]
SERIOUSLY? :D
Don't forget to link to boost serialization, it's not header-only library.
> Undefined symbols for architecture x86_64
Try compile with different options: -m32 or -m64