[ndnSIM] use of undeclared identifier 'g_log'

Junxiao Shi shijunxiao at email.arizona.edu
Tue Aug 16 14:16:21 PDT 2016


Hi Xuxiang

I guess you are missing NS_LOG_COMPONENT_DEFINE.
See
https://www.nsnam.org/docs/release/3.22/manual/html/logging.html#how-to-add-logging-to-your-code

Yours, Junxiao

On Mon, Aug 15, 2016 at 3:03 PM, Xuxiang Tian <xuxiangtian at ucla.edu> wrote:

> I have included declaration below
>
> #include "ns3/log.h"
> #include "ns3/ndnSIM/NFD/common.hpp"
> #include "ns3/ndnSIM/NFD/core/logger.hpp"
>
> But when I tried to compile a cpp file including sentence NS_LOG_FUNCTION(this
> << &interest), I met the following problem. Kindly, please let me know if
> you have some thoughts
>
> ../src/ndnSIM/model/ndn-net-device-link-service.cpp:60:3: error: use of
> undeclared identifier 'g_log'
> ./ns3/log-macros-enabled.h:219:11: note: expanded from macro
> 'NS_LOG_FUNCTION'
>           NS_LOG_APPEND_TIME_PREFIX;                            \
>           ^
> ./ns3/log-macros-enabled.h:40:7: note: expanded from macro
> 'NS_LOG_APPEND_TIME_PREFIX'
>   if (g_log.IsEnabled (ns3::LOG_PREFIX_TIME))                   \
>       ^
>
> --
> Xuxiang
>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160816/e8cd9d92/attachment.html>


More information about the ndnSIM mailing list