template link error with GCC v3.3.5

D

dale_bertrand

I'm having a problem linking my code using GCC v3.3.5. I get the
following error:

Csw_CONCAT.o(.gnu.linkonce.r._ZTV25ScxFifoPutMonitorListenerI9CswBfmCmdE+0x10):
undefined reference to
`ScxFifoPutMonitorListener<CswBfmCmd>::handleTransaction(scv_shared_ptr<ScxTransactionDescBaseType>,

So the linker is complaining that it cannot find the template method
described in the error.

When I do an 'nm' on the .o the method is there. I get:
_ZN25ScxFifoPutMonitorListenerI9CswBfmCmdE17handleTransactionE14scv_shared_ptrI26ScxTransactionDescBaseTypeESs

Using 'c++filt' this translates to exactly the method the linker is
complaining about:

ScxFifoPutMonitorListener<CswBfmCmd>::handleTransaction(scv_shared_ptr<ScxTransactionDescBaseType>,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >)

This is the version of GCC I'm using:
g++ (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)

Are there any know problems with GCC v3.3.5 linking code with
templates?

Thanks,
Dale
 
V

Victor Bazarov

I'm having a problem linking my code using GCC v3.3.5. I get the
following error:

Csw_CONCAT.o(.gnu.linkonce.r._ZTV25ScxFifoPutMonitorListenerI9CswBfmCmdE+0x10):
undefined reference to
`ScxFifoPutMonitorListener<CswBfmCmd>::handleTransaction(scv_shared_ptr<ScxTransactionDescBaseType>,


So the linker is complaining that it cannot find the template method
described in the error.

When I do an 'nm' on the .o the method is there. I get:
_ZN25ScxFifoPutMonitorListenerI9CswBfmCmdE17handleTransactionE14scv_shared_ptrI26ScxTransactionDescBaseTypeESs

Using 'c++filt' this translates to exactly the method the linker is
complaining about:

ScxFifoPutMonitorListener<CswBfmCmd>::handleTransaction(scv_shared_ptr<ScxTransactionDescBaseType>,


This is the version of GCC I'm using:
g++ (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)

Are there any know problems with GCC v3.3.5 linking code with
templates?

Maybe. Why do you think it's a "known problem" and not your own screw-up?

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top