0

我在编译具有一些 C++ 依赖项的 Ruby 库时遇到了一些问题。我在某处读到添加以下代码可以解决问题:

sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

但是现在当我运行时,swift build我得到了这个错误:

/Users/me/Repository/myproject-swift: error: manifest parse error(s):
/usr/local/include/libxml2/libxml/module.modulemap:1:8: error: redefinition of module 'libxml2'
module libxml2 [system] [extern_c] {
       ^
/usr/local/include/libxml2/module.modulemap:1:8: note: previously defined here
module libxml2 [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/module.modulemap:1:8: error: redefinition of module 'AppleTextureEncoder'
module AppleTextureEncoder [system] [extern_c] {

朋友建议的解决方案是删除所有符号链接,usr/local/include当我列出它时,符号链接的数量很大。我可以做些什么来从下面的路径中删除符号链接?

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/*

谢谢!

4

1 回答 1

0

要删除提供的该路径的所有不需要的符号链接,请运行:

find usr/local/include -lname '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/*' -delete

来源:https ://unix.stackexchange.com/a/39341/404343

于 2020-04-05T23:48:00.807 回答