简体   繁体   English

pecl在Mac上安装mongodb,致命错误:找不到“ Security / Security.h”文件

[英]pecl install mongodb on mac, fatal error: 'Security/Security.h' file not found

I used pecl to install MongoDB extension on mac, but it fails 我使用pecl在Mac上安装MongoDB扩展,但失败

I get the following error: 我收到以下错误:

ERROR: 'make' failed 错误:“ make”失败

/private/tmp/pear/install/mongodb/src/libmongoc/src/libmongoc/src/mongoc/mongoc-rand-common-crypto.c:25:10: fatal error: 'Security/Security.h' file not found /private/tmp/pear/install/mongodb/src/libmongoc/src/libmongoc/src/mongoc/mongoc-rand-common-crypto.c:25:10:致命错误:找不到“ Security / Security.h”文件

1 error generated. 产生1个错误。

make: *** [src/libmongoc/src/libmongoc/src/mongoc/mongoc-rand-common-crypto.lo] Error 1 制作:*** [src / libmongoc / src / libmongoc / src / mongoc / mongoc-rand-common-crypto.lo]错误1

ERROR: `make' failed 错误:“ make”失败

What is wrong? 怎么了?

fixed, the real problem is Security/Security.h can't be found in macOS 10.14.3, and there is another similar problem to CoreFoundation/CFBase.h it can be fixed by following steps: 已修复,真正的问题是在macOS 10.14.3中找不到Security / Security.h,并且还有一个与CoreFoundation / CFBase.h类似的问题,可以通过以下步骤解决:

cd mongodb-1.5.3/include
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Versions/A/Headers/ Security
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/ CoreFoundation
brew install pcre
make

done DONE

Attention:"ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Versions/A/Headers/ Security" may be failed because there is a "security" directory in your "include" directory.(MAC OS X's default setting is case-insensitive) My solution is "mv security _security". 注意:“ ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Versions/A/Headers/Security”可能会失败,因为您的目录中存在“ security”目录“ include”目录。(MAC OS X的默认设置不区分大小写)我的解决方案是“ mv security _security”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM