NTPDoser icon indicating copy to clipboard operation
NTPDoser copied to clipboard

some error in build gcc

Open quydx opened this issue 7 years ago • 6 comments

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 ? :)

quydx avatar Sep 29 '17 02:09 quydx

under the ubuntu?

DrizzleRisk avatar Nov 20 '17 09:11 DrizzleRisk

I am using Ubuntu and it is the same situation.

wlals10117 avatar Jan 06 '18 15:01 wlals10117

centos 7 and debian 8 also have this problem

CR-SB avatar Apr 15 '18 07:04 CR-SB

You have to put -pthread at the end

giacomoarienti avatar Feb 24 '19 16:02 giacomoarienti

You have to put -pthread at the end

not work?

hklcf avatar Jul 16 '19 05:07 hklcf

gcc NTPDoser.cpp -o gahr -lstdc++ -phtread

working in kali 2019.4

DenDeze avatar Dec 03 '19 09:12 DenDeze