[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20000925: Compiling .pgm programs (cont.)



>From: Anthony James Wimmers <address@hidden>
>Organization: UVa
>Keywords: 200009251536.e8PFaib08985 McIDAS build

Tony,

re: how to build an executable from a .pgm file

>I followed your instructions, but I have a linking error. This is what's
>added to my makefile:
>
>./mccomp -O -s -vendor -o mddpi.k main.o mddpi.o -L. -lmcidas
>f77 -s -O -o mddpi.k main.o mddpi.o -L. -R/usr/dt/lib -L/usr/dt/lib
>-R/usr/openwin/lib -L/usr/openwin/lib -R/opt/SUNWspro/lib
>-L/opt/SUNWspro/lib -lmcidas -lgen -lsocket -lnsl -lm
>ld: fatal: symbol `main' is multiply defined:
>       (file main.o and file mddpi.o);
>ld: fatal: symbol `__fsr_init_value' is multiply defined:
>       (file main.o and file mddpi.o);
>ld: fatal: File processing errors. No output written to mddpi.k
>link   mddpi.k:                FAILED
>
>
>I looked through the mddpi.pgm file, to see if I could change the names
>of the symbols 'main' and '__fsr_init_value', but since they weren't in
>the program at all, I can see that I don't know what the error really
>means.

The mddpi.pgm file that you sent me looks like a typical McIDAS PGM
file.  The main entry point for these modules is SUBROUTINE MAIN0.
They do not (should not, anyway) have a 'main' entry point.  That is
reserved for standalone C programs and the McIDAS module main.o which
is created from main.c.  However, what I found in the file mddpi.pgm
that you sent me showed me what was going on.  Edit the file and go to
the very bottom; you will see:

 537  continue

      imaxval=arrmax

      return
      end

      end


The extra 'end' line at the very end is causing the duplicate 'main' entry
point error!.  What you need to do is delete the last line and rerun
your 'make mddpi.k'.

As far as the '__fsr_init_value' entry point, this looks like a library
one (the leading double underscore is a dead giveaway), but the error
might go away when you get rid of the duplicate 'main' problem.

>I'm including the program mddpi.pgm, and the files makefile and 
>makelog, just in case you wish to look at them. (The makelog has the 
>record of two attempted makes.) I hope it's not too messy.

Thanks for including the files.  The makelog output and mddpi.pgm source
was what I needed to figure out the problem.

>thanks,

Later...

Tom