WebServer icon indicating copy to clipboard operation
WebServer copied to clipboard

Compile error in macOS mojave 10.14.4

Open DinghaoLI opened this issue 5 years ago • 1 comments

编译器版本:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

报错信息:

/Users/dinghaoli/Desktop/Playground/WebServer/WebServer/base/FileUtil.cpp:51:12: error: use of undeclared identifier 'fwrite_unlocked' return fwrite_unlocked(logline, 1, len, fp_); ^ 1 error generated. make[2]: *** [WebServer/base/CMakeFiles/libserver_base.dir/FileUtil.cpp.o] Error 1 make[1]: *** [WebServer/base/CMakeFiles/libserver_base.dir/all] Error 2 make: *** [all] Error 2

DinghaoLI avatar May 19 '19 16:05 DinghaoLI

我没在macos上跑过,macos上可能没有fwrite_unlocked这个接口吧,你换成fwrite试试。

linyacool avatar May 20 '19 07:05 linyacool