简体   繁体   English

Apple Mach-O Linker警告:如何摆脱它但不影响我的朋友

[英]Apple Mach-O Linker Warning: how to get rid of it but not affect my friend

So, I get the following warning when compiling my app: 因此,在编译我的应用时收到以下警告:

ld: warning: directory not found for option '-F/Users/my peer's usernamr/Desktop/desktopFolder/my app's name/GoogleCastFramework-2.0-Release'

I know the reason it is giving me the warning: my friend and I are working on two different computers, so for the app to compile, we need different search paths for the GoogleCastFramework. 我知道它给我警告的原因:我的朋友和我正在使用两台不同的计算机,因此要编译应用程序,我们需要为GoogleCastFramework提供不同的搜索路径。 I know I can get rid of the warning by deleting the framework search path, but that means my peer has to add the search path again when he works on the project. 我知道我可以通过删除框架搜索路径来消除警告,但这意味着我的同伴必须在他处理项目时再次添加搜索路径。 But it's annoying to see it all the time if I don't get rid of it. 但是如果我没有摆脱它,一直看到它是很烦人的。 Is there anyway I can delete the search path while not affecting my peer? 无论如何我可以删除搜索路径而不影响我的同行吗? Can I get rid of it by somehow relocating the framework folder? 我可以通过某种方式重新定位框架文件夹摆脱它吗?

If you're both using the framework, you should put it in a folder relative to the Xcode project. 如果您都在使用框架,则应将其放在相对于Xcode项目的文件夹中。 For example: 例如:

project/
    yourProject.xcodeproj
    yourSource.c
    Frameworks/
        GoogleCast.framework

Then add it to the project using a project-relative path rather than an absolute path. 然后使用项目相对路径而不是绝对路径将其添加到项目中。 You can set it to a relative path by selecting the framework in the project navigator, opening the "Utilities" tab, and changing the "Location" pop-up to "Relative To Project". 您可以通过在项目导航器中选择框架,打开“实用程序”选项卡,并将“位置”弹出窗口更改为“相对于项目”来将其设置为相对路径。

如果在项目设置中使用绝对用户名而不是绝对库路径编辑库路径,则无论用户如何,都将获得正确的路径。

Follow this steps: 请遵循以下步骤:

  • Go to Targets - Build Phases - Link Binary with Libraries 转到目标 - 构建阶段 - 将二进制文件链接到库
  • Click on + & add the GoogleCastFramework 点击+并添加GoogleCastFramework

Hope this will help. 希望这会有所帮助。

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

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