undefined reference to

Barry Smith bsmith at mcs.anl.gov
Sun Aug 19 13:11:55 CDT 2007



 Not sure what the problem is, but 
you should remove the lines
> mvec.o: mvec.F                                                                                                        
>     mpif90 -c mvec.F  
you do not need them.

  Please send ALL the output when you run make exe after the change.

   Barry



On Sun, 19 Aug 2007, Waad Subber wrote:

> Hello everyone
> 
> I am calling a subroutine from my main program, and when I compile the code I get an error message  (undefined reference to 'mvec_') referring to the call statement in the main program. I have defined the subroutine as external in the main program using (external mvec), but the problem still unsolved ..! 
> 
> The makefile looks like:
> 
> OBJS= mvec.o
> CFLAGS        = 
> FFLAGS        = 
> CPPFLAGS        =
> FPPFLAGS        =
> 
> 
> include ${PETSC_DIR}/bmake/common/base
> 
> all: $(OBJS)
> 
> mvec.o: mvec.F
>     mpif90 -c mvec.F
> 
> exe: pro.o $(OBJS) 
>     -${FLINKER} -o exe pro.o $(OBJS)  ${PETSC_LIB}
>      ${RM} -f pro.o
> 
> include ${PETSC_DIR}/bmake/common/test
> 
> Can any one help me with this issue please ...!
> 
> Thanks
> 
> Waad
> 
>        
> ---------------------------------
> Park yourself in front of a world of choices in alternative vehicles.
> Visit the Yahoo! Auto Green Center.




More information about the petsc-users mailing list