页次: 1
https://stackoverflow.com/questions/41490491/c-stdthis-threadsleep-for-compiler-error-clang
I think, you need to add -lpthread for it to work.
good,ok
OS=Windows_NT LDFLAGS="-L/usr/i686-w64-mingw32/lib/ -lws2_32 -lwsock32" CC=i686-w64-mingw32-gcc make
Setting version information: v1.4.1-87-g78a7566
i686-w64-mingw32-gcc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -DNO_MMAP -L/usr/i686-w64-mingw32/lib/ -lws2_32 -lwsock32 -o sunxi-fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c -lws2_32
fexc.c: In function ‘main’:
fexc.c:312:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
filename[1] = argv[optind+1]; /* out */
~~~~~~~~~~~~^~~~~~~~~~~~~~~~
fexc.c:313:2: note: here
case 1:
^~~~
i686-w64-mingw32-gcc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -DNO_MMAP -L/usr/i686-w64-mingw32/lib/ -lws2_32 -lwsock32 -o sunxi-bootinfo bootinfo.c -lws2_32
i686-w64-mingw32-gcc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -DNO_MMAP `pkg-config --cflags libusb-1.0` -L/usr/i686-w64-mingw32/lib/ -lws2_32 -lwsock32 -o sunxi-fel fel.c progress.c soc_info.c fel_lib.c fel-spiflash.c -lws2_32 `pkg-config --libs libusb-1.0`
/tmp/cc3LYByw.o:fel.c:(.text+0x1a47): undefined reference to `nanosleep'
collect2: error: ld returned 1 exit status
Makefile:136: recipe for target 'sunxi-fel' failed
make: *** [sunxi-fel] Error 1
这是哪里顺序不对吗?
页次: 1