f



ranlib produces "has no symbols" msg

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 ...

0
Art
1/21/2010 2:15:15 AM
comp.sys.mac.programmer.help 4653 articles. 2 followers. Post Follow

14 Replies
1829 Views

Similar Articles

[PageSpeed] 10

Art Werschulz <agw@comcast.net> writes:

>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.:

Was the library stripped as part of it being built   (cf   man strip)?

-- 
Chris.

0
Chris
1/21/2010 2:35:31 AM
Hi.

Chris McDonald <chris@csse.uwa.edu.au> writes:

> Art Werschulz <agw@comcast.net> writes:
>
>>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.:
>
> Was the library stripped as part of it being built   (cf   man strip)?

Not as far as I can tell.

I'm also getting the following msgs when trying to use these libraries:

ld: warning: in ../GUI/libbookgui.a, file is not of required architecture
ld: warning: in /usr/local/lib/libjpeg.dylib, file is not of required architecture

Again, this problem did not occur with Mac OS 10.5.

Suggestions?  Thanks.

-- 
Art Werschulz (agw STRUDEL comcast.net)
.... insert clever quote here ...
0
Art
1/22/2010 8:04:06 PM
Art Werschulz wrote:
> Hi.
> 
> Chris McDonald <chris@csse.uwa.edu.au> writes:
> 
>> Art Werschulz <agw@comcast.net> writes:
>>
>>> 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.:
>> Was the library stripped as part of it being built   (cf   man strip)?
> 
> Not as far as I can tell.
> 
> I'm also getting the following msgs when trying to use these libraries:
> 
> ld: warning: in ../GUI/libbookgui.a, file is not of required architecture
> ld: warning: in /usr/local/lib/libjpeg.dylib, file is not of required architecture
> 
> Again, this problem did not occur with Mac OS 10.5.
> 
> Suggestions?  Thanks.
> 
Hmmm... do a file /usr/local/lib/libjpeg.dylib and see how many archs it 
was made for.  Same for ../GUI/libbookgui.a
At least it is a start.
0
GreyCloud
1/23/2010 4:52:23 AM
Hi.

GreyCloud <mist@cumulus.com> writes:

>>>> 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.:
>>> Was the library stripped as part of it being built   (cf   man strip)?
>>
>> Not as far as I can tell.
>>
>> I'm also getting the following msgs when trying to use these libraries:
>>
>> ld: warning: in ../GUI/libbookgui.a, file is not of required architecture
>> ld: warning: in /usr/local/lib/libjpeg.dylib, file is not of required architecture
>>
>> Again, this problem did not occur with Mac OS 10.5.
>>
>> Suggestions?  Thanks.
>>
> Hmmm... do a file /usr/local/lib/libjpeg.dylib and see how many archs
> it was made for.  Same for ../GUI/libbookgui.a
> At least it is a start.

agw@home:~$ file /usr/local/lib/libjpeg.dylib 
/usr/local/lib/libjpeg.dylib: Mach-O 64-bit dynamically linked shared library x86_64
agw@home:~$ file /usr/local/lib/libbookgui.a
/usr/local/lib/libbookgui.a: current ar archive random library

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

0
Art
1/24/2010 12:34:59 AM
Art Werschulz wrote:
> Hi.
> 
> GreyCloud <mist@cumulus.com> writes:
> 
>>>>> 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.:
>>>> Was the library stripped as part of it being built   (cf   man strip)?
>>> Not as far as I can tell.
>>>
>>> I'm also getting the following msgs when trying to use these libraries:
>>>
>>> ld: warning: in ../GUI/libbookgui.a, file is not of required architecture
>>> ld: warning: in /usr/local/lib/libjpeg.dylib, file is not of required architecture
>>>
>>> Again, this problem did not occur with Mac OS 10.5.
>>>
>>> Suggestions?  Thanks.
>>>
>> Hmmm... do a file /usr/local/lib/libjpeg.dylib and see how many archs
>> it was made for.  Same for ../GUI/libbookgui.a
>> At least it is a start.
> 
> agw@home:~$ file /usr/local/lib/libjpeg.dylib 
> /usr/local/lib/libjpeg.dylib: Mach-O 64-bit dynamically linked shared library x86_64
> agw@home:~$ file /usr/local/lib/libbookgui.a
> /usr/local/lib/libbookgui.a: current ar archive random library
> 

Well, the first file only has one arch and the latest snowleopard files 
have x86_64 and i386 archs in the dylibs.  This is done for those that 
are using Xcode and want to deliver a multiple arch package.
Strange that there weren't the usual three others of the G4, G5 and one 
older one.

The libbookgui.a is a static library.  The fact that the linker checked 
the file associated with the current arch and what the library was 
compiled to shows that they don't match.
Also, my system doesn't show these libs.  What was the source of these 
libs?  It may help a lot in determing what is going on.
0
GreyCloud
1/24/2010 2:58:18 AM
Hi.

GreyCloud <mist@cumulus.com> writes:

>> agw@home:~$ file /usr/local/lib/libjpeg.dylib
>> /usr/local/lib/libjpeg.dylib: Mach-O 64-bit dynamically linked
>> shared library x86_64
>> agw@home:~$ file /usr/local/lib/libbookgui.a
>> /usr/local/lib/libbookgui.a: current ar archive random library
>>
>
> Well, the first file only has one arch and the latest snowleopard
> files have x86_64 and i386 archs in the dylibs.  This is done for
> those that are using Xcode and want to deliver a multiple arch
> package.
> Strange that there weren't the usual three others of the G4, G5 and
> one older one.

This may be leftover from Leopard.

> The libbookgui.a is a static library.  The fact that the linker
> checked the file associated with the current arch and what the library
> was compiled to shows that they don't match.

It was compiled from source, as follows:
  g++ -I -Wall -time -O3 -DNDEBUG   -c -o GUI.o GUI.cc
  g++ -I -Wall -time -O3 -DNDEBUG   -c -o Graph.o Graph.cc
  g++ -I -Wall -time -O3 -DNDEBUG   -c -o Simple_window.o Simple_window.cc
  g++ -I -Wall -time -O3 -DNDEBUG   -c -o Window.o Window.cc
  ar rcs libbookgui.a GUI.o Graph.o Simple_window.o Window.o     
The source is Bjarne Stroustrup's simple GUI, associated with his new
textbook.

> Also, my system doesn't show these libs.  What was the source of these
> libs?  It may help a lot in determing what is going on.

Note that when I ran
  ranlib /usr/local/lib/lib*.a | grep "no symbols"
gave the following results:
  ranlib: file: /usr/local/lib/libfltk.a(Fl_x.o) has no symbols
  ranlib: file: /usr/local/lib/libfltk.a(fl_overlay_visual.o) has no symbols
  ranlib: file: /usr/local/lib/libfltk.a(fl_call_main.o) has no symbols
  ranlib: file: /usr/local/lib/libfltk.a(scandir.o) has no symbols
  ranlib: file: /usr/local/lib/libfltk.a(keysym2Ucs.o) has no symbols
  ranlib: file: /usr/local/lib/libfltk.a(utf8Input.o) has no symbols
  ranlib: file: /usr/local/lib/libfltk.a(utf8Utils.o) has no symbols
  ranlib: file: /usr/local/lib/libfltk.a(utf8Wrap.o) has no symbols
FLTK was compiled from source, built via the usual
  make configure
  make
  make install

-- 
Art Werschulz (agw STRUDEL comcast.net)
.... insert clever quote here ...
0
Art
1/24/2010 3:42:57 AM
Art Werschulz wrote:
> Hi.
> 
> GreyCloud <mist@cumulus.com> writes:
> 
>>> agw@home:~$ file /usr/local/lib/libjpeg.dylib
>>> /usr/local/lib/libjpeg.dylib: Mach-O 64-bit dynamically linked
>>> shared library x86_64
>>> agw@home:~$ file /usr/local/lib/libbookgui.a
>>> /usr/local/lib/libbookgui.a: current ar archive random library
>>>
>> Well, the first file only has one arch and the latest snowleopard
>> files have x86_64 and i386 archs in the dylibs.  This is done for
>> those that are using Xcode and want to deliver a multiple arch
>> package.
>> Strange that there weren't the usual three others of the G4, G5 and
>> one older one.
> 
> This may be leftover from Leopard.
> 
>> The libbookgui.a is a static library.  The fact that the linker
>> checked the file associated with the current arch and what the library
>> was compiled to shows that they don't match.
> 
> It was compiled from source, as follows:
>   g++ -I -Wall -time -O3 -DNDEBUG   -c -o GUI.o GUI.cc
>   g++ -I -Wall -time -O3 -DNDEBUG   -c -o Graph.o Graph.cc
>   g++ -I -Wall -time -O3 -DNDEBUG   -c -o Simple_window.o Simple_window.cc
>   g++ -I -Wall -time -O3 -DNDEBUG   -c -o Window.o Window.cc
>   ar rcs libbookgui.a GUI.o Graph.o Simple_window.o Window.o     
> The source is Bjarne Stroustrup's simple GUI, associated with his new
> textbook.
> 

Hey, thnx for the heads up.  What's the books title?

>> Also, my system doesn't show these libs.  What was the source of these
>> libs?  It may help a lot in determing what is going on.
> 
> Note that when I ran
>   ranlib /usr/local/lib/lib*.a | grep "no symbols"
> gave the following results:
>   ranlib: file: /usr/local/lib/libfltk.a(Fl_x.o) has no symbols
>   ranlib: file: /usr/local/lib/libfltk.a(fl_overlay_visual.o) has no symbols
>   ranlib: file: /usr/local/lib/libfltk.a(fl_call_main.o) has no symbols
>   ranlib: file: /usr/local/lib/libfltk.a(scandir.o) has no symbols
>   ranlib: file: /usr/local/lib/libfltk.a(keysym2Ucs.o) has no symbols
>   ranlib: file: /usr/local/lib/libfltk.a(utf8Input.o) has no symbols
>   ranlib: file: /usr/local/lib/libfltk.a(utf8Utils.o) has no symbols
>   ranlib: file: /usr/local/lib/libfltk.a(utf8Wrap.o) has no symbols
> FLTK was compiled from source, built via the usual
>   make configure
>   make
>   make install
> 
Instead of using ranlib, use nm to list symbols in a library.  Do a man nm.
Also use libtool as it is supposed to replace ranlib and ar... at least 
that is what it says when doing man ranlib.
Then if no symbols are there, then the file was stripped.
You may have to look into that configure file to look for any commands 
that will strip this library.
0
GreyCloud
1/25/2010 6:25:00 AM
Hi.

GreyCloud <mist@cumulus.com> writes:

>> The source is Bjarne Stroustrup's simple GUI, associated with his new
>> textbook.
>
> Hey, thnx for the heads up.  What's the books title?
>

Programming: Principles and Practice Using C++
The book's website is 
    http://www.stroustrup.com/Programming

-- 
Art Werschulz (agw STRUDEL comcast.net)
.... insert clever quote here ...
0
Art
1/26/2010 1:41:36 AM
Art Werschulz wrote:
> Hi.
> 
> GreyCloud <mist@cumulus.com> writes:
> 
>>> The source is Bjarne Stroustrup's simple GUI, associated with his new
>>> textbook.
>> Hey, thnx for the heads up.  What's the books title?
>>
> 
> Programming: Principles and Practice Using C++
> The book's website is 
>     http://www.stroustrup.com/Programming
> 

I checked it out and it looks like an excellent book.
Hopefully, they also supplied the library code.
0
GreyCloud
1/26/2010 10:05:22 PM
Hi.

GreyCloud <mist@cumulus.com> writes:

>> Programming: Principles and Practice Using C++
>> The book's website is     http://www.stroustrup.com/Programming
>
> I checked it out and it looks like an excellent book.
> Hopefully, they also supplied the library code.

The library code is on the website, along with all the other code
examples from the text.

-- 
Art Werschulz (agw STRUDEL comcast.net)
.... insert clever quote here ...
0
Art
1/28/2010 12:36:09 AM
Art Werschulz wrote:
> Hi.
> 
> GreyCloud <mist@cumulus.com> writes:
> 
>>> Programming: Principles and Practice Using C++
>>> The book's website is     http://www.stroustrup.com/Programming
>> I checked it out and it looks like an excellent book.
>> Hopefully, they also supplied the library code.
> 
> The library code is on the website, along with all the other code
> examples from the text.
> 
I know.  I now have the code and I'm looking thru it.
There are enough #ifndef or #ifdef on which platform you are building
for.  I've went thru a similar problem with a more formal text book 
written by Holub and found it to be a problem when one library is left 
out and you have to purchase the extra disk, which is why I made the 
last comment about supplying the library code.
Hopefully, the static declarations on these functions are correct, as it 
caused me great problems in building code in the past.  It shouldn't, 
but it does.  Statics are file scope only for functions.

Were I of any help to you?
0
GreyCloud
1/28/2010 6:59:01 PM
Hi.

It turns out the fix was to downgrade to FLTK 1.1.10.  Everything was
fine after that.
-- 
Art Werschulz (agw STRUDEL comcast.net)
.... insert clever quote here ...

0
Art
2/2/2010 11:59:13 PM
Art Werschulz wrote:
> Hi.
> 
> It turns out the fix was to downgrade to FLTK 1.1.10.  Everything was
> fine after that.

That is rather strange.
It could be that there were various versions of FLTK for different 
platforms and I'm presuming that that one would've worked under a MS 
windows.
0
GreyCloud
2/3/2010 5:10:56 AM
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 ...
0
adam
10/3/2016 4:19:49 AM
Reply: