This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Compilation error
Hi David,
> gcc version 4.5.1 20100516 (prerelease) (GCC)
>
> I compile all the source code with no errors or warnings. ?The error
> occurs at link time with the following:
>
> obj/testOfCGNS.o: In function `testread':
> /home/david/USB/Topics/MBFLO/refactor/src/IO/CGNS/sandbox/onetype/gfortran-bug/final/unit-tests/testOfCGNS.F90:166:
> undefined reference to `vtab$ablockinterface.2635'
> obj/testOfCGNS.o: In function `testwrite':
> /home/david/USB/Topics/MBFLO/refactor/src/IO/CGNS/sandbox/onetype/gfortran-bug/final/unit-tests/testOfCGNS.F90:248:
> undefined reference to `vtab$ablockinterface.2635'
> /home/david/USB/Topics/MBFLO/refactor/src/IO/CGNS/sandbox/onetype/gfortran-bug/final/unit-tests/testOfCGNS.F90:303:
> undefined reference to `vtab$ablockinterface.2635'
> collect2: ld returned 1 exit status
thanks for reporting this bug, which (as Salvatore pointed out) is a
known problem. Unfortunately upgrading to 4.6 trunk will not (yet)
help you, but hopefully we will get this nasty bug fixed soon. If you
want to help, it might be useful if you could isolate this bug in your
code and construct a minimal test case. We already have a test case in
PR 44064/65, but having another one might help us nail down the
specific conditions under which this occurs.
> Obviously, the 'vtab%ablockinterface' symbol is nowhere to be found.
Yes, this is an internal symbol we construct, in order to implement
polymorphic variables. This internal symbol should not be visible to
the user at all, and that you get an error about it is clearly a bug.
> The 'ablockinterface' is an extended derived type defined in a module
> that is public which is included into the module where 'testread' and
> 'testwrite' functions reside through a 'use' statement, so it should
> be visible to the functions.
Do you have any "use, only: ..." clauses in your code? If yes, does
removing the "only" help? This might be a possible workaround ...
Cheers,
Janus