I got it working, would like to post the steps here in case others might encounter the same issue later on.
1) First of all, what I had before is ns-3 3.36, which is not good for cppyy, as nsnam site said, at least 3.37 is required.
2) So I installed the latest and greatest 3.41 (currentlyI can find from
nsnam.org), my pythone script with RateErrorModule creating works now.
3) A few nuisance during installation of 3.41 (and 3.40 as well)
- if you configure ns3 with recommended "$ ./ns3 configure --enable-examples --enable-tests", it will fail with:
FAILED: src/wifi/CMakeFiles/libwifi-test.dir/test/wifi-mlo-test.cc.o
So I only configure with "./ns3 configure", it went through.
Then I run "./ns3 build", it went through as well, after wait a cup of coffee.
- My first test of running " ./ns3 run examples/tutorial/first.py " took a long time, it went through after I had my dinner, don't exactly know how long it took....I blame it to my slow laptop.
- running my script with RateErrorModule creating went though as well, no compile error, just slow, which is fine for me :)
...
#create error module
em = ns.CreateObject("RateErrorModel")
em.__deref__().SetAttribute("ErrorRate", ns.DoubleValue(0.001))
devices.Get(0).__deref__().SetAttribute("ReceiveErrorModel", ns.PointerValue(em))
...