Chris Facchini
unread,Jan 26, 2011, 10:52:30 AM1/26/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ns-3-users
Hi,
Is it possible to have NS_LOG facilities in templated classes?
The problem is, in case of a templated class I have to define class
methods in the header file (gcc doesn't support the 'export' keyword).
So, when I try to add NS_LOG_COMPONENT_DEFINE("CompName") in the .h
file, the compiler complains that g_log has been already declared
somewhere else (which is true, but for other components).
Errors go like this:
../src/contrib/cogent/variable.cc:17: error: redefinition of
‘ns3::LogComponent ns3::g_log’
../src/contrib/cogent/data.h:51: error: ‘ns3::LogComponent ns3::g_log’
previously declared here
../src/contrib/cogent/acting-variable.cc:17: error: redefinition of
‘ns3::LogComponent ns3::g_log’
../src/contrib/cogent/data.h:51: error: ‘ns3::LogComponent ns3::g_log’
previously declared here
Any idea how to solve this mystery?
TIA,
Chris