I'm linking an object file with several libraries and I'm getting some
strange errors.  The linker is complaining about several undefined functions
but when I use nm to peek into the library, I see that the functions are in
fact in the library.  All of the functions that it complains about are in
one file (f77io.cpp).  This file is being linked into a library
(libsupport.a) that is then linked with my object file.

The Makefile for my program returns in part:

  <snip>
  cc   SimpleAORunsimpleao.o  -lg++ -ldfftw -lwavetrain -ltempus -lsupport \
  -lfftengine -lrecorder -lmatrixio -L../../tony/linux_wt/tempus/src/support \
  -L../../tony/linux_wt/tempus/src/tempus \
  -L../../tony/linux_wt/tempus/src/portinc \
  -L../../tony/linux_wt/tempus/src/recorder \
  -L../../tony/linux_wt/tempus/src/matrixio \
  -L../../tony/linux_wt/tempus/src/fftengine \
  -L../../tony/linux_wt/wavetrain/src -o SimpleAORunsimpleao
  <snip>
  ../../tony/linux_wt/tempus/src/matrixio/libmatrixio.a(NmatrixIO.o): In
  function matrix_openFile(char *&, int *, _IO_FILE *&, char *)':
  /nfs/u0/home/seward/MZA/tony/linux_wt/tempus/src/matrixio/NmatrixIO.cpp:44:
  undefined reference to f77openformattedfile(int, char const *)'
  <snip>

When I do nm -Cn libsupport.a > libsupport.symbols and look at
libsupport.symbols it reads in part

  <snip>
  f77io.o:
           U __throw
           U f77close_
           U f77openform_
           U f77rewindfile_
           U smtxload_
           U smtxsave_
  00000000 ? __FRAME_BEGIN__
  00000000 T f77openformattedfile(int, char const *)
  0000002c T f77closefile(int)
  0000003c T f77rewindfile(int)
  0000004c T MatrixXSaveF(int *, char *, int *, int *, int *, int *, float *,
                          float *, char *, int *)
  000000a8 T MatrixXLoadF(int *, char *, int *, int *, int *, int *, float *,
                          float *, char *, int *)
  <snip>
  
When I touch f77io.cpp and run make I get

  cd /nfs/u0/home/seward/MZA/tony/linux_wt/tempus/src/support/
  make -k 
  In ~.bashrc ...
  c++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include/tempus
  -I../../include/support -I../../include/matrixio -I../../include/portinc
  -g -O2 -DLINUX -DNO_MATLAB -c f77io.cpp
  rm -f libsupport.a
  ar cru libsupport.a ArrayBase.o FoP_operator_classes.o FoP_other.o
  GridGeometry.o GridStaticArrays.o GridStuff.o MathUtil.o Position.o Random.o
  RandomSequenceGenerator.o RectangularRegion.o error.o f77io.o fpetrap.o 
  ranlib libsupport.a

  Compilation finished at Wed Aug 30 11:41:16

So the functions that the linker complains about not finding are being
compiled from f77io.cpp into f77io.o and then archived into libsupport.a and
libsupport.s is being linked with my object file.

I've been through the info pages for ld and I can't find anything that helps.

Can anyone help?
Tony



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to