This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/71839] undefined reference to `_gfortran_caf_stop_str'
- From: "mexas at bristol dot ac.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Jul 2016 17:52:58 +0000
- Subject: [Bug fortran/71839] undefined reference to `_gfortran_caf_stop_str'
- Auto-submitted: auto-generated
- References: <bug-71839-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71839
--- Comment #3 from Anton Shterenlikht <mexas at bristol dot ac.uk> ---
In the end I reduced the program to:
use cgca
if (.true.) stop
end
The problem seems to appear if I move the
static library from where it was built to another location.
E.g if I build my library, and the program, in some directory,
then all is fine:
$ ls libcgpack.a
libcgpack.a
$ caf -c z.f90 -I .
$ caf z.o -L . -lcgpack
$ ./a.out
STOP
However, if I move the library to another place, then I get this error:
$ cp libcgpack.a ~/lib/
$ caf z.o -L ~/lib/ -lcgpack
z.o: In function `MAIN__':
z.f90:(.text+0xf): undefined reference to `_gfortran_caf_stop_str'
collect2: error: ld returned 1 exit status
Does this look like a binutils problem?
Or am I making some mistake in creating the library?