在XCode 4中添加依赖项目

时间:2023-01-13 20:32:38

I am trying to add a dependent project in XCode 4. The link to the project is this: https://github.com/jverkoey/ObjQREncoder

我正在尝试在XCode 4中添加一个依赖项目。项目的链接是:https://github.com/jverkoey/ObjQREncoder

The author described a way to add this but it's for XCode 3. I am trying to add it to XCode 4. I dragged the project inmy frameworks, then went to Targets and QREncoder in Target Dependencies. Then I added libQREncoder.a in "Link Binary with Libraries". Then I added this for header search path "src/Classes".

作者描述了一种添加这个的方法,但是它是针对XCode 3的。我想把它添加到XCode 4中。我将项目拖到我的框架中,然后转向目标和目标依赖项中的QREncoder。然后我libQREncoder补充道。a在“链接二进制与库”中。然后我为头搜索路径“src/ class”添加了这个。

When I include "QREncoder/QREncoder.h", it gives me this error: file://somePath/FINALQRAppDelegate.m: error: Lexical or Preprocessor Issue: 'QREncoder/QREncoder.h' file not found

当我包括“QREncoder / QREncoder。h,它给我这个错误:file:/ somePath/FINALQRAppDelegate。错误:词法或预处理器问题:“QREncoder/QREncoder”。h的文件未找到

This is how my project is set up: 在XCode 4中添加依赖项目

我的项目就是这样建立的:

FINALQR is my project to which I am trying to add the dependency and the dependency project is in src.

FINALQR是我要添加依赖项的项目,依赖项项目在src中。

Thanks.

谢谢。

The problem is it doesn't recognize the QREncoder class.

问题是它不承认QREncoder类。

2 个解决方案

#1


1  

Only Xcode 4 workspaces benefit from shared build folders across multiple projects. From the main menu, select File > New > New Workspace... Save the workspace, then drag your subprojects into its Project navigator panel.

只有Xcode 4工作区可以从跨多个项目的共享构建文件夹中获益。在主菜单中,选择File >新建>工作区…保存工作区,然后将您的子项目拖放到它的Project navigator面板中。

Be careful where you place them (make sure you're not making one project a subproject of another within the workspace) so that they're all top-level projects within your workspace. This will cause them to share the build folder and automatic dependency detection should work.

在放置它们的地方要小心(确保您没有在工作区中进行另一个项目的子项目),这样它们都是您工作空间中的*项目。这将导致它们共享构建文件夹,并且自动依赖项检测应该有效。

Unless, of course, you have custom search paths set in your targets' build settings. :-)

当然,除非您在目标的构建设置中设置了自定义搜索路径。:-)

#2


0  

I think your problem is you need to set the following as your search path:

我认为你的问题是你需要设置如下的搜索路径:

"$(SRCROOT)/src/Classes"

not

"src/Classes"

If you already have an Xcode4 project, you should be able to drag QREncoder into it as a subproject, as I think you have already done, and then add the .a file, also as you've done.

如果您已经有了一个Xcode4项目,那么您应该能够将QREncoder作为子项目拖到其中,就像我认为您已经完成的那样,然后添加.a文件,就像您已经完成的那样。

#1


1  

Only Xcode 4 workspaces benefit from shared build folders across multiple projects. From the main menu, select File > New > New Workspace... Save the workspace, then drag your subprojects into its Project navigator panel.

只有Xcode 4工作区可以从跨多个项目的共享构建文件夹中获益。在主菜单中,选择File >新建>工作区…保存工作区,然后将您的子项目拖放到它的Project navigator面板中。

Be careful where you place them (make sure you're not making one project a subproject of another within the workspace) so that they're all top-level projects within your workspace. This will cause them to share the build folder and automatic dependency detection should work.

在放置它们的地方要小心(确保您没有在工作区中进行另一个项目的子项目),这样它们都是您工作空间中的*项目。这将导致它们共享构建文件夹,并且自动依赖项检测应该有效。

Unless, of course, you have custom search paths set in your targets' build settings. :-)

当然,除非您在目标的构建设置中设置了自定义搜索路径。:-)

#2


0  

I think your problem is you need to set the following as your search path:

我认为你的问题是你需要设置如下的搜索路径:

"$(SRCROOT)/src/Classes"

not

"src/Classes"

If you already have an Xcode4 project, you should be able to drag QREncoder into it as a subproject, as I think you have already done, and then add the .a file, also as you've done.

如果您已经有了一个Xcode4项目,那么您应该能够将QREncoder作为子项目拖到其中,就像我认为您已经完成的那样,然后添加.a文件,就像您已经完成的那样。