Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:18:57+00:00 2026-06-04T18:18:57+00:00

I have an XCode workspace with a user interface project (UI) and a core

  • 0

I have an XCode workspace with a user interface project (UI) and a core logic project (Core). I want OCUnit unit tests in the UI project, so I have added a new target for testing, as is commonly done.

I am able to run tests just fine until I put in import statements for classes in the main UI target which in turn reference the Core project.

The error I get is “Lexical or Preprocessor Issue ‘xxx.h’ file not found”. I do not get this message when I build the main UI target directly.

It’s as if the main UI target knows about Core when it is built, but when it is referenced from the test target it seems to know nothing about Core.

I took the step of adding a reference to the core project using the “Link Binaries with Libraries” The item in the list remains red. A clue? Maybe, but the red reference in the Link list doesn’t keep the UI target from building and using core classes. I also made the main target a dependency of the test target.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:19:00+00:00Added an answer on June 4, 2026 at 6:19 pm

    Make sure you check out the Apple sample code “Unit Tests”:
    https://developer.apple.com/library/ios/#samplecode/UnitTests/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011742

    Make sure your library project is set as a Dependancy in your OCUnit test target’s build phases, AND it’s linked as a library.

    Open up your project in Xcode. In the File menu, go to Project Settings… (or Workspace Settings… if you are using a workspace). Click Advanced… and make sure Unique is checked. Clean and rebuild.

    Check your BUILD_PRODUCTS_DIR to see if the headers for your library show up in there. If they don’t, first check the build phases in your library target to make sure the headers you need are in the Public section (the Project section may work as well, but try Public and see if that solves your issue).

    That covers the most common problems people seem to run into in your situation. When in doubt, check the target settings in the UnitTests sample against yours. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Xcode 4 I want to use the workspace to have multiple project types
Background: I have Xcode 3.2.3 installed and want to distribute a project, ideally to
I have two projects in an Xcode workspace and I want to be able
I have two projects in a Xcode 4 workspace. Then, I drag a new
I have done the following so far: Created workspace Added my project Added the
I’ve installed Snow Leopard, have Xcode 3.2 and 3.0 iPhone SDK. I want my
I have an Xcode project with several static library dependancies set up in the
I have an Xcode 4.2 project with ios5 targeting 4.3 and am now suddenly
I have an XCode iPad project using a navigation controller. I tried to get
I have two projects in an Xcode workspace. I would like to add the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.