This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Template instantiation problem


I'm having a problem with templates for gcc snapshot 20000501 on the
powerpc-ibm-aix4.3.3.0 platform.
The attached cpp file compiles/links/runs fine under the same snapshot
version on i686-pc-linux-gnu with the command line "g++ -o aix-template-bug
aix-template-bug.cpp", but when I run the same command under aix, I get the
following unresolved symbols:

[/u/conwaym/src/cpptest]-> g++ -o aix-template-bug aix-template-bug.cpp
ld: 0711-317 ERROR: Undefined symbol: PropertySet::Value<int> virtual table
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
collect2: ld returned 8 exit status

I tried doing "g++ -frepo -c aix-template-bug.cpp", then "g++ -frepo -o
aix-template-bug aix-template-bug.o" (Am I even using this correctly?), but
ended up getting even more unresolved symbols, one of which was the one
reported above.

This probably has something to do with my tricky use of templates to
generically store any type into a single STL collection - but it is valid
C++ code, and does work under other G++'s as well as HP aCC and MS VC++ 6.0.

Does anyone know whats going on here, and if/how I can work around it?  If
you need me to generate any more detail, just let me know.  Any help
appreciated, thanks,

Matt

Here is the output with -bnoquiet enabled:

g++ -bnoquiet -o aix-template-bug aix-template-bug.cpp
collect: recompiling aix-template-bug.cpp
collect: relinking
(ld): halt 4
(ld): setopt r/o->w
(ld): setopt nodelcsect
(ld): savename aix-template-bug
(ld): filelist 7 2
(ld): i /lib/crt0.o
(ld): i /tmp/cccVHxZa.o
(ld): i /tmp/ccKdNS8a.o
(ld): lib
/u/conwaym/gcc-aix-20000501/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/2.96/libstdc+
+.a
(ld): lib /usr/lib/libm.a
(ld): i
/u/conwaym/gcc-aix-20000501/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/2.96/libgcc.a
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libc.a[shr.o]: 2172 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 11 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 78 symbols imported.
LIBRARY: Shared object libc.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 7
(ld): exports /tmp/ccwRa8Zc.x
EXPORTS: Symbols exported: 1
(ld): initfini _GLOBAL__FI_aix_template_bug _GLOBAL__FD_aix_template_bug
(ld): resolve
RESOLVE: 1381 of 8284 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 35 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR
Import-File{Shared-object}
                              RLD: Address  Section  Rld-type Referencing
Symbol

 ---------------------------------------------------------------------------
----
---------------
ld: 0711-317 ERROR: Undefined symbol: PropertySet::Value<int> virtual table
PropertySet::Value<int> virtual table[38]    ER RW
aix-template-bug.cpp(/tmp/ccKdNS8a.o)
                                   0001020c .data    R_POS    [652]
<PropertySet::Value<int> virtual table>
ER: The return code is 8.
collect2: ld returned 8 exit status

aix-template-bug.cpp


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]