简体   繁体   English

未酿酒的头文件

[英]Unbrewed Header Files

I'll be taking a course at my university next semester in OCaml, so I've decided to install it in advance. 下学期我将在我的大学的OCaml上一门课程,所以我决定提前安装。 To do this, I've installed Homebrew on my OS X. However, whenever I try to install opam I receive this error message: 为此,我在OS X上安装了Homebrew。但是,每当我尝试安装opam时,都会收到以下错误消息:

Unbrewed header files were found in /usr/local/include. 在/ usr / local / include中找到未酿酒的头文件。 If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. 如果您没有故意将它们放在此处,则它们在构建Homebrew公式时可能会引起问题,并且可能需要删除。

Unexpected header files: 意外的头文件:

/usr/local/include/libpng12/png.h
/usr/local/include/libpng12/pngconf.h
/usr/local/include/libpng14/png.h
/usr/local/include/libpng14/pngconf.h
/usr/local/include/libpng15/png.h
/usr/local/include/libpng15/pngconf.h
/usr/local/include/libpng15/pnglibconf.h

I've tried removing these files manually, but it says gives me an error message saying "Permission Denied." 我尝试手动删除这些文件,但是它显示了一条错误消息,提示“权限被拒绝”。 Does anyone know how to fix this? 有谁知道如何解决这一问题? Thanks. 谢谢。

You should think at least a little bit about how the files got there. 您应该至少考虑一下文件如何到达那里。 You don't want to throw them away if they're useful. 如果它们有用,您不想将它们扔掉。

If you're convinced you don't need them you can become super-user temporarily and remove them: 如果您确信不需要它们,则可以暂时成为超级用户并将其删除:

$ sudo mv /usr/local/include/libpng1[245] /tmp

Be extremely careful when typing this (or any) sudo line. 键入此(或任何) sudo行时要格外小心。 You can mess things up very badly with your super powers. 您的超级能力可能使事情变得非常糟糕。

When sudo asks for a password, type your own password. sudo要求输入密码时,键入您自己的密码。

This will only work if you are an "administrative" user of your Mac. 仅当您是Mac的“管理”用户时,此方法才有效。 There's always at least one administrative user. 总是至少有一个管理用户。

What this does is move the files to the /tmp directory. 这是将文件移动到/ tmp目录。 If you decide you need them, you can move them back. 如果您决定需要它们,可以将其移回。 Eventually you might want to throw them away completely. 最终,您可能希望将它们完全丢弃。

First run brew doctor if brew throws an error. 如果brew抛出错误,请首先运行brew doctor

Second, if you get a Permission Denied error, make sure whatever you're doing is completely OK, (as in first run brew doctor and find the exact problem) and prepend sudo to your command (ie rm to sudo rm ). 其次,如果出现“ Permission Denied错误,请确保您所做的一切都完全正常(如在第一次运行brew doctor ,找到确切的问题),并在命令前加上sudo (即rmsudo rm )。 Then enter your administrator password. 然后输入您的管理员密码。

Third, and just to emphasize, BE CAREFUL WITH sudo . 第三,并且要强调一点,请谨慎使用sudo Make sure whatever you're doing is perfectly safe. 确保您所做的一切都是绝对安全的。

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

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