Error while compiling

76 views
Skip to first unread message

Fernando Salvago

unread,
Aug 8, 2016, 5:17:22 AM8/8/16
to ns-3-users
Hi everybody,

I'm starting to use NS3 after two years and I'm getting the next error: 

In file included from ./ns3/trace-source-accessor.h:24:0,
                 from ./ns3/type-id.h:25,
                 from ./ns3/object-base.h:23,
                 from ./ns3/object.h:29,
                 from ./ns3/object-factory.h:24,
                 from ./ns3/simulator.h:29,
                 from ../src/lte/helper/lte-helper.h:25,
                 from ../src/lte/helper/lte-helper.cc:23:
./ns3/callback.h: In instantiation of ‘R ns3::MemPtrCallbackImpl<OBJ_PTR, MEM_PTR, R, T1, T2, T3, T4, T5, T6, T7, T8, T9>::operator()(T1) [with OBJ_PTR = ns3::Ptr<ns3::LteEnbPhy>; MEM_PTR = void (ns3::LteUePhy::*)(const ns3::SpectrumValue&); R = void; T1 = const ns3::SpectrumValue&; T2 = ns3::empty; T3 = ns3::empty; T4 = ns3::empty; T5 = ns3::empty; T6 = ns3::empty; T7 = ns3::empty; T8 = ns3::empty; T9 = ns3::empty]’:
../src/lte/helper/lte-helper.cc:3626:1:   required from here
./ns3/callback.h:600:63: error: pointer to member type ‘void (ns3::LteUePhy::)(const ns3::SpectrumValue&)’ incompatible with object type ‘ns3::LteEnbPhy’
     return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1);
                                                               ^
./ns3/callback.h:600:77: error: return-statement with a value, in function returning 'void' [-fpermissive]
     return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1);
                                                                             ^

Waf: Leaving directory `/home/fourgreen/workspace/ns-3.25_home/build'
Build failed
 -> task in 'ns3-lte' failed (exit status 1): 
{task 36891600: cxx lte-helper.cc -> lte-helper.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../src/lte/helper/lte-helper.cc', '-c', '-o', '/home/fourgreen/workspace/ns-3.25_home/build/src/lte/helper/lte-helper.cc.1.o']


I don't know what is the best way to debug this because I don't know the line of code. I only can see in Eclipse that, the methods it doesn't link well are the methods related to traces like EnableUlPhyTraces, EnableUlTxPhyTraces, EnableUlRxPhyTraces... Can anyone help me?

Thanks in advance.
Fernando

Tommaso Pecorella

unread,
Aug 8, 2016, 9:59:07 AM8/8/16
to ns-3-users
Hi,

quite strange error. Mind running the attached script in the ns-3 directory and copy-paste the results ?

Thanks,

T.
report.sh

Fernando Salvago

unread,
Aug 9, 2016, 2:22:07 AM8/9/16
to ns-3-users
Thanks Tommaso for your quick answer.

I run the script, the ouput is this:



~/workspace/ns-3.25_home$ ./report.sh 
 ** System info **
Linux 4Green 3.5.0-54-generic #81~precise1-Ubuntu SMP Tue Jul 15 04:02:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 12.04.5 LTS \n \l

 ** Compiler type and version **
gcc (Ubuntu 4.9.2-0ubuntu1~12.04) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 ** ns-3 version **


Do you see something wrong? 

Thanks very much.
Fernando

Fernando Salvago

unread,
Aug 9, 2016, 4:08:21 AM8/9/16
to ns-3-users
Hi again!

After reading what report.sh does, I'm going to contextualize how I got this error. I'm trying to merge the changes I got from version NS-3.19 to the current version NS-3.25.

After checking thoroughly the code I think that the problem must be related to the class LteChunkProcessor because when merging LteHelper I had to change the previous LteSinrChunkProcessor for LteChunkProcessor. I also think this because in the hint we can read: 
./ns3/callback.h:600:63: error: pointer to member type void (ns3::LteUePhy::)(const ns3::SpectrumValue&)’ incompatible with object type ns3::LteEnbPhy

I'm currently studying this class in order to find out that error, but I think it is very likely to be in there.

Do you agree with me?

Thanks
Fernando

Tommaso Pecorella

unread,
Aug 9, 2016, 4:32:40 AM8/9/16
to ns-3-users
Hi,

well, that was going to be the second question: have you modified the code ?
It seems that the answer is yes. In this case we can't help much as we don't know exactly what you did to the code.

Mind that from a version to another we try to keep the public APIs and the ones that are used by the users, but the internal ones (i.e., the implementation) could be radically changed. Some classes are even removed.
As a consequence, forward-porting stuff might be a non-trivial task.

Cheers,

T.

Fernando Salvago

unread,
Aug 9, 2016, 4:56:46 AM8/9/16
to ns-3-users
Hi,

Yes, the code has some changes. 

Thanks for your answer. In case I solve the error I will lte you know.
Fernando

Fernando Salvago

unread,
Aug 9, 2016, 7:05:03 AM8/9/16
to ns-3-users
Hi Tommaso,

I solved this issue. It has been hard to solve because with that trace I couldn't find the line where it happens. 
As I said before, I have some changes in the original code and the problem was that when I merge the class LteHelper I made a mistake merge the methods InstallSinleEnbDevice and InstallSingleUeDevice in which I used wrongly LteChunkProcessor. 

Maybe it will help you if you can add a log or something.

Best regards
Fernando

Tommaso Pecorella

unread,
Aug 9, 2016, 8:24:37 PM8/9/16
to ns-3-users
Sorry, but... a log on in the compilation phase is quite... impossible (!).
Unless, of course, you want to modify the compiler.

T.
Reply all
Reply to author
Forward
0 new messages