CLion (+ns3) missparse of C++ method implementation
Hello,
I am currently working on some networking simulation with ns3 and made it work with cmake/clion. To implement some first experiments I copied the source of a current ns3-application (UdpEchoServer/-Client/-Helper) and it does work well. Up to one small part that just baffles me.
The UpdTestClient class contains some methods, of those only two(!) are misrecognized by clion.
These are:
void UdpTestClient::SetFill(uint8_t fill, uint32_t dataSize) { ... }
void UdpTestClient::SetFill(uint8_t * fill, uint32_t fillSize, uint32_t dataSize) { ...
CLion gives the following errors for the first:
Expected ',' or ')' between uint8_t and fill
Can't resolve variable fill.
And for the second:
Can't resolve variable 'uint32_t' for the first uint32_t
Can't resolve variable 'fillSize'
Expected ',' or ')' betweent he two
Duplicate declaration of global variable 'dataSize'
The code compiles and works as intended (as it is just a renamed copy of some ns3 code anyways), but I can't imagine how to prevent this and the formatting problems this produces, as auto formating does not work on missunderstood code.
I would be glad for any links or suitable google terms (the error messages lead to non helpful google results, sorry) or a way to silence that part of the code and manually format it without getting it messed up by autoformat the next time.
Thank you,
David
Please sign in to leave a comment.
I have the same issue, but deleting the CMake cache and reloading the CMake project usually solves it.
Hi! I was wondering, how did you manage to make ns3 work with cmake?
Thanks a lot in advance
I'm awfully late to answer that, but I've replaced all waf stuff with cmake. I've opened a PR with the upstream project.