• ranlib produces "has no symbols" msg

    From adam.mendoza@gmail.com@21:1/5 to Art Werschulz on Sun Oct 2 21:19:49 2016
    This error still happens on OS X 10 El Capitan. The result is that even a small test program fails the linking phase with FLTK.

    /Applications/CLion.app/Contents/bin/cmake/bin/cmake --build /Users/adam/Library/Caches/CLion2016.2/cmake/generated/fltk_test-f06748b0/f06748b0/Debug --target all -- -j 8
    Scanning dependencies of target fltk_test
    [ 50%] Building CXX object CMakeFiles/fltk_test.dir/main.cpp.o
    [100%] Linking CXX executable fltk_test
    Undefined symbols for architecture x86_64:
    "fl_define_FL_SHADOW_LABEL()", referenced from:
    _main in main.cpp.o
    "Fl::run()", referenced from:
    _main in main.cpp.o
    "Fl_Box::Fl_Box(int, int, int, int, char const*)", referenced from:
    _main in main.cpp.o
    "Fl_Group::end()", referenced from:
    _main in main.cpp.o
    "Fl_Window::show(int, char**)", referenced from:
    _main in main.cpp.o
    "Fl_Window::Fl_Window(int, int, char const*)", referenced from:
    _main in main.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]: *** [fltk_test] Error 1
    make[1]: *** [CMakeFiles/fltk_test.dir/all] Error 2
    make: *** [all] Error 2


    /usr/bin/ar cr ../lib/libfltk.a ... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(Fl_x.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(fl_dnd.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(fl_overlay_visual.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(fl_call_main.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(scandir.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(keysym2Ucs.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(utf8Input.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(utf8Utils.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(utf8Wrap.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(Fl_x.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(fl_dnd.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(fl_overlay_visual.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(fl_call_main.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(scandir.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(keysym2Ucs.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(utf8Input.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(utf8Utils.o) has no symbols
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libfltk.a(utf8Wrap.o) has no symbols


    On Wednesday, January 20, 2010 at 6:15:15 PM UTC-8, Art Werschulz wrote:
    Hi.

    Running Mac OS X 10.6.2 (Snow Leopard) ...

    When running ranlib, I sometimes get error msgs saying that a particular library entry has no symbols. This most recently happened with the FLTK libraries, e.g.:
    $ ranlib libfltk.a
    ranlib: file: libfltk.a(Fl_x.o) has no symbols
    ranlib: file: libfltk.a(fl_overlay_visual.o) has no symbols
    ranlib: file: libfltk.a(fl_call_main.o) has no symbols
    ranlib: file: libfltk.a(scandir.o) has no symbols
    ranlib: file: libfltk.a(keysym2Ucs.o) has no symbols
    ranlib: file: libfltk.a(utf8Input.o) has no symbols
    ranlib: file: libfltk.a(utf8Utils.o) has no symbols
    ranlib: file: libfltk.a(utf8Wrap.o) has no symbols

    I did not have this problem with Mac OS X 10.5 (Leopard).

    Has anybody run into this problem? If so, what's the fix?

    Many thanks.

    --
    Art Werschulz (agw STRUDEL comcast.net)
    ... insert clever quote here ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)