Nginx安裝 出現 In function ‘ngx_murmur_hash2’錯誤


閱讀原文


src/core/ngx_murmurhash.c: In function ‘ngx_murmur_hash2’:
src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[2] << 16;
         ~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
     case 2:
     ^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[1] << 8;
         ~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
     case 1:
     ^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:432: objs/src/core/ngx_murmurhash.o] Error 1

原因:將警告信息當作錯誤信息進行了處理
解決方法:使用編輯器打開nginx/objs/Makefile,刪除CFLAGS中的-Werror,如圖所示;

重新進行make操作即可

接着你會出現問題

src/os/unix/ngx_user.c: In function ‘ngx_libc_crypt’:
src/os/unix/ngx_user.c:35:7: error: ‘struct crypt_data’ has no member named ‘current_salt’
     cd.current_salt[0] = ~salt[0];
       ^
make[1]: *** [objs/Makefile:712: objs/src/os/unix/ngx_user.o] Error 1

原因:源代碼問題
解決方法:修改ngx_user.c /src/os/unix/ngx_user.c

注釋掉藍線標注的代碼
重新make即可成功


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM