NTPDoser
NTPDoser copied to clipboard
some error in build gcc
NTPDoser.cpp: In function ‘char* strftimeval(const timeval*, char*)’: NTPDoser.cpp:86:57: warning: '0' flag ignored with precision and ‘%d’ gnu_printf format [-Wformat=] sprintf(buf + len, ".%06.6d", (int)(tv->tv_usec)); ^ NTPDoser.cpp: In function ‘int main(int, char**)’: NTPDoser.cpp:342:30: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-string] if(GetNtpServers("ntp.list") == NULL) ^ NTPDoser.cpp:348:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-string] NTP_SERVERS_ARR = GetNtpServersArr(GetNtpServers("ntp.list"),"\n"); ^ /tmp/cc4WkY4I.o: In function main': NTPDoser.cpp:(.text+0xcdd): undefined reference to
pthread_create' NTPDoser.cpp:(.text+0xd50): undefined reference to
pthread_create' collect2: error: ld returned 1 exit status
I get error when
gcc NTPDoser.cpp -o NTPDoser -lstdc++
Can anybody give me some hint to fix ? :)
under the ubuntu?
I am using Ubuntu and it is the same situation.
centos 7 and debian 8 also have this problem
You have to put -pthread at the end
You have to put -pthread at the end
not work?
gcc NTPDoser.cpp -o gahr -lstdc++ -phtread
working in kali 2019.4