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

我使用 pecl </ code>在mac上安装MongoDB扩展,但失败了</ p>

我收到以下错误:</ p>


错误:'make'失败</ p>

/ private / tmp /pear/install/mongodb/src/libmongoc/src/libmongoc/src/mongoc/mongoc-rand-common-crypto.c:25:10:致命错误:找不到'Security / Security.h'文件</ p>

生成1个错误。</ p>

make:*** [src / libmongoc / src / libmongoc / src / mongoc / mongoc-rand-common-crypto.lo] 错误1 </ p>

错误:`make'失败</ p>
</ blockquote>

出了什么问题?</ p>
</ div>

展开原文

原文

I used pecl to install MongoDB extension on mac, but it fails

I get the following error:

ERROR: 'make' failed

/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

1 error generated.

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

ERROR: `make' failed

What is wrong?

dounieyan2036
dounieyan2036 谢谢
接近 2 年之前 回复

1个回答



修复,
真正的问题是在macOS 10.14.3中找不到Security / Security.h,还有另一个类似的 CoreFoundation / CFBase.h的问题可以通过以下步骤解决:</ p>

  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
</ code> </ pre>

完成</ p>

注意:“ln -s / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / System / Library / Frameworks / Security.framework / Versions / A / Headers / Security“可能失败,因为”include“目录中有一个”security“目录。(MAC OS X's 默认设置不区分大小写)
我的解决方案是“mv security _security”。</ p>
</ div>

展开原文

原文

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:

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

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".

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问