Note that there are some explanatory texts on larger screens.

plurals
  1. POIncludes fail to resolve correctly in Xcode workspace
    text
    copied!<p>I'm having trouble linking to a static library in Xcode 5. I'm not really familiar with a lot of the build settings info so bare with me. I did read the chapter on building and using a static library in the Pro iOS 5 Tools. What it told me to do after creating your static library, was to link against the framework in the Build Phases tab. That part is pretty straight forward. Then it says in the Build Settings, under "Header Search Paths", to add:</p> <pre><code>$(BUILT_PRODUCTS_DIR) </code></pre> <p>Then in order to use my static library, I just import it like so:</p> <pre><code>#import "ConversionCalculator/ConversionCalculator.h" </code></pre> <p>So this used to work up until yesterday. I tried adding a new static library to my project which didn't seem to work. So I cleaned my project, and tried rebuilding again, but now Xcode complains about <code>#import "ConversionCalculator/ConversionCalculator.h"</code>. It says </p> <p>Lexical or Preprocessor issue. 'ConversionCalculator/ConversionCalculator.h' file could not be found. </p> <p>I was wondering if anyone has any tips on debugging this. I've looked through different tutorials like this: <a href="http://blog.stevex.net/2012/04/static-libraries-in-xcode/" rel="nofollow">http://blog.stevex.net/2012/04/static-libraries-in-xcode/</a> <a href="http://cocoamanifest.net/articles/2011/06/library-management-with-xcode-workspaces.html" rel="nofollow">http://cocoamanifest.net/articles/2011/06/library-management-with-xcode-workspaces.html</a> <a href="http://www.raywenderlich.com/41377/creating-a-status-library-in-ios-tutorial" rel="nofollow">http://www.raywenderlich.com/41377/creating-a-status-library-in-ios-tutorial</a></p> <p>But I can't seem to find the "golden way" to link to a static lib, or how to troubleshoot why Xcode cannot find my file. My file structure is setup on my machine like so:</p> <pre><code>Projects\ DistanceCalculator\DistanceCalculator.xcodeproj ConversionCalculator\ConversionCalculator.xcodeproj DistanceCalculator.workspace </code></pre> <p>Like I said, this all used to work too when I followed the tutorial in Pro iOS 5 Tools book. Now I don't know why my workspace cannot find ConversionCalculator when it has used it before. The part I find hard is different articles say different things about the header search path, and I'm not sure what the best way to populate that field is. Any thoughts? Thanks in advance!</p> <p>Edit: I'll add that I can build for the device without errors. But when I switch to the iPhone simulator, it gives me that error about not being able to find the file. I also see that I get this warning:</p> <pre><code>ConversionCalculator was rejected as an implicit dependency for 'libConversionCalculator.a' because its architectures 'i386' didn't contain all required architectures 'i386 x86_64' </code></pre> <p>Looking at that, I'm not sure what that means. If it means that my library is not being built for all architectures, I just tried creating a Target that builds for all architectures according to the wenderlich article in the above link. That seems to work as when I go to the dervieddata folder, I see for debug, release, and universal, I see the libConversionCalculator.a file. But then when I go back into the workspace and try to rebuild the project for the simulator, I get that could not find file error and the implicit warning.</p> <p>Edit #2: I just saw a warning flag on Xcode that says upgrade to recommended Build Settings. Now I get no errors. Not sure what happened... but I guess no errors is good.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload