0

I am a beginning in programming and I need help in my code in Fortran. The error displayed when compiling is


joaovitor1729@joao:~/Fortran/centrol-foton$ make teste_intmult
gfortran -O3 -c -o teste_intmult.o teste_intmult.f90
cc -L/home/joaovitor1729/lib  teste_intmult.o   -o teste_intmult
/usr/bin/ld: teste_intmult.o: in function `MAIN__':
teste_intmult.f90:(.text+0x93): undefined reference to `cuhre_'
/usr/bin/ld: teste_intmult.f90:(.text+0xd3): undefined reference to `_gfortran_st_write'
/usr/bin/ld: teste_intmult.f90:(.text+0xe7): undefined reference to `_gfortran_transfer_character_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x14a): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x15a): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x1b8): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x211): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x221): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x229): undefined reference to `_gfortran_st_write_done'
/usr/bin/ld: teste_intmult.f90:(.text+0x2b1): undefined reference to `suave_'
/usr/bin/ld: teste_intmult.f90:(.text+0x2ec): undefined reference to `_gfortran_st_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x300): undefined reference to `_gfortran_transfer_character_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x35e): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x36e): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x3cc): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x427): undefined reference to `_gfortran_transfer_array_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x437): undefined reference to `_gfortran_transfer_integer_write'
/usr/bin/ld: teste_intmult.f90:(.text+0x43f): undefined reference to `_gfortran_st_write_done'
/usr/bin/ld: teste_intmult.o: in function `fx_':
teste_intmult.f90:(.text+0x4cd): undefined reference to `exp'
/usr/bin/ld: teste_intmult.o: in function `main':
teste_intmult.f90:(.text.startup+0x5): undefined reference to `_gfortran_set_args'
/usr/bin/ld: teste_intmult.f90:(.text.startup+0x16): undefined reference to `_gfortran_set_options'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: teste_intmult] Error 1
rm teste_intmult.o

This is my Makefile


...

F90C = gfortran

F90BANDEIRAS = -O3

LDFLAGS = -L${HOME}/lib

LIBS = -ldquadpack -lm

LIBM = -lcuba -lm

OBJC = defaults.o parcom.o

EXEC =

NCLVL = 15

.SUFIXOS: .f90 .f .o

.KEEP_STATE:

#####################################

teste_intmult: ${OBJC} teste_intmult.o ${F90C} -o run.teste_intmult ${F90FLAGS} ${OBJC} teste_intmult.o ${LDFLAGS} ${LIBS}

#####################################

%.o: %.f90 ${F90C} ${F90FLAGS} -c -o $@ $<

#####################################

clean: -rm -vf run.* . ~ *~ *.o a.out *.mod genmod

veryclean: -rm -vf *.o .mod . ~ ~ .exe .sh.o a.out run . genmod . *.run ############### o fim ###############
  • Welcome, please take the [tour] and read [ask] and [mcve]. If you have a problem with some code, you have to show it. Copy and paste the code into your question, do not use external links or pictures. – Vladimir F Героям слава Feb 12 '22 at 20:15
  • 2
    In this case, it might be enough to show your Makefile. When linking using a C compiler, you need to link the `libgfortran` library using `-lgfortran`. Or just link with `gfortran`. We have previous questions about this error messages. – Vladimir F Героям слава Feb 12 '22 at 20:18
  • 1
    Does this answer your question? [What is an undefined reference/unresolved external symbol error and how do I fix it in Fortran?](https://stackoverflow.com/questions/66855252/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – veryreverie Feb 13 '22 at 09:34
  • forgive me. this is the first time i use stackoverflow – joaovitor1729 Feb 13 '22 at 14:27
  • I looked for the ldquapack library but I didn't find it – joaovitor1729 Feb 13 '22 at 14:33

0 Answers0