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

  • Home
  • SEARCH
  • 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 4017120
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:49:22+00:00 2026-05-20T09:49:22+00:00

I am keen to write a library project with tests, even if I then

  • 0

I am keen to write a library project with tests, even if I then include the code in other projects (as opposed to linking to the lib.) for inclusion on ios projects.

It seems checking the ‘Include unit tests’ isn’t enough for xcode 4 to properly initialise a project with tests, and after looking through the Apple documentation I can’t find anything relevant.

Does anybody know of any resources or tutorials for getting this working?

Even with the default Cocoa Touch Static Library project, upon choosing “Test” from the “Product” menu, it fails (when linking) with this error (the project is called test1):

library not found for -ltest1
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

Any help would be much appreciated.

  • 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-05-20T09:49:22+00:00Added an answer on May 20, 2026 at 9:49 am

    OK I finally got this working.

    The trick was to create the library without checking the ‘Include unit tests’ option in XCode 4. Then I created a new target myself.

    (in xcode 4)

    1. Create a new Cocoa Touch Static Library project and DON’T check “Include Unit Tests”
    2. Select the project in the navigator
    3. Go into the “Build Phases” tab
    4. Click ‘Add Target’ and choose ‘Cocoa Touch Unit Testing Bundle’
    5. Go through the wizard until the target is created
    6. Then go in the “Product” menu and choose “Edit Scheme…”
    7. Make sure your project (not the test target) is selected and, select “Test”
    8. Click + to add a new target
    9. Choose your test project and click Add
    10. Now press Cmd+U (this is the shortcut for “Product > Test” menu item) and you’ll notice the default test fails.

    I hope this helps.

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

Sidebar

Related Questions

I am writing views, not so keen to write templates right away. But I
I have a quad core machine and would like to write some code to
So, I've been looking at Hadoop with keen interest, and to be honest I'm
I'm very interested in what F# has to offer and I'm very keen to
With the sort of programs I write (working with raw file data) I often
I'm trying to write a unit test that will raise an event on a
I'm keen to drink some modern dynamic language koolaid, so I've believed all the
I want to write a simple DSL in C#. Nothing too complicated. I'm looking
I want to write some email scanning software and don't understand how to setup
I would like to write some simple Mario-like game from scratch using language C.

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.