robertdavidgraham / masscan

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.
GNU Affero General Public License v3.0
23.55k stars 3.08k forks source link

make compile error #329

Open ChengUU opened 6 years ago

ChengUU commented 6 years ago

src/smack1.c:1497:14: warning: implicit declaration of function 'rdtsc' is invalid in C99 [-Wimplicit-function-declaration] cycle1 = rdtsc(); ......

tmp/smack1.o:在函数‘smack_benchmark’中: /home/chengxx/github/masscan/src/smack1.c:1497:对‘rdtsc’未定义的引用 /home/chengxx/github/masscan/src/smack1.c:1505:对‘rdtsc’未定义的引用

ghost commented 6 years ago

That's not an error, it's a warning. Which version of clang do you have installed?

ChengUU commented 6 years ago

my clang version: Ubuntu clang version 3.4-1ubuntu3......it's just a waring, but compile failure. it works well when i download masscan 1.0.3...

ghost commented 6 years ago

Try updating clang as well as build-essential:

image

ChengUU commented 6 years ago

Thank you very much. I compile masscan-master successfully, the key to the problem lies in the version of clang.

Before updat the version of clang:clang -v default After updating the version of clang:clang -v default