netbee icon indicating copy to clipboard operation
netbee copied to clipboard

tools compile error: no match for ‘operator!=’

Open aleasims opened this issue 5 years ago • 0 comments

While compiling tools after main libs, I've catched the following:

$ make
...
~/netbee/tools/nbextractor/anonimize-ip.cpp:74:27: error: no match for ‘operator!=’ (operand types are ‘std::basic_istream<char>’ and ‘long int’)
  while (getline(fp, line) != NULL)
...
nbextractor/CMakeFiles/nbextractor.dir/build.make:86: recipe for target 'nbextractor/CMakeFiles/nbextractor.dir/anonimize-ip.cpp.o' failed
make[2]: *** [nbextractor/CMakeFiles/nbextractor.dir/anonimize-ip.cpp.o] Error 1
CMakeFiles/Makefile2:213: recipe for target 'nbextractor/CMakeFiles/nbextractor.dir/all' failed
make[1]: *** [nbextractor/CMakeFiles/nbextractor.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I may be mistaken, but != operator cannot be used here with NULL. It may be connected with C++11 upgrade. Reference to a similar problem: https://stackoverflow.com/a/41871487

So then, my hotfix is to change file tools/nbextractor/anonimize-ip.cpp: line 74:

while (getline(fp, line) != NULL)

to

while (getline(fp, line))

and it works for me now.

I'm not aware about the whole code, so I'm not creating a pull request for that.

My sys properties:

  • Ubuntu 18.08 Linux 4.15.0-48-generic
  • g++ (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
  • cmake version 3.10.2
  • GNU Make 4.1 Built for x86_64-pc-linux-gnu

aleasims avatar May 15 '19 11:05 aleasims