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 7691977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:44:47+00:00 2026-05-31T20:44:47+00:00

Let me start out by saying that I’m not a C developer and I

  • 0

Let me start out by saying that I’m not a C developer and I know very little about actually writing real world C code. I’ve been doing some research to find a xUnit framework that I can use to write tests for C code and based on what I’ve found it seems like Unity is the one that I want to go with. It seems simple enough, but I really just don’t know what to do after I download the zip file from Unity’s website. It doesn’t seem to have the normal configure/make/make install, and if it did, I’m not sure that is what I should be using anyway. It does, however, ship with some rake tasks, but none of those seemed to be any kind of “install” task. As a last resort I tried to just copy the 3 source files in with my code (which I really hope is not the right thing to do), but when I try that I get an error trying to compile my c file with gcc, but I think this should be working. Here is my set up:

src/
  mycode.c
  unity.c
  unity.h
  unity_internals.h

Here is the source for mycode.c

/* mycode.c */
#include "unity.h"

void test_sample(void)
{
    TEST_ASSERT_EQUAL_INT(0, 0);
}

When I run gcc mycode.c I get:

Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
  "_UnityAssertEqualNumber", referenced from:
      _test_sample in ccyHByv6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

(I get a similar error when I try to compile unity.c with gcc). Which I assume means that the code that ships with unity requires a different compiler than what I have which is:

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)

or that maybe unity is not compatible with a 64 bit processor… (I’m running on Mac OS 10.7.3 with a 2.4 GHz Intel Core 2 Duo processor – another thing that may or may not be relavent is that I’ve got XCode Version 4.3 (4E109) and also Command Line Tools for XCode) At this point I’m just grasping at straws and I’m in way over my head.

My question is, what is the correct process to go through to take a 3rd party C library, such as Unity, and make it available to my C code? Do I need to install something like in Python or Ruby or add something to my path like in Java or something else? Shouldn’t just dropping unity’s code in with mine work? Am I doing something wrong or is Unity or both? I really just want to be able to test drive C code using Unity. Any help would be greatly appreciated. Thanks in advance!

  • 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-31T20:44:49+00:00Added an answer on May 31, 2026 at 8:44 pm

    I figured out my problem. It turns out that unity requires you to define a setup and a teardown function and if you do not, you will get errors similar to the one that I was running into.

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

Sidebar

Related Questions

Let me start out by saying that I'm not a JavaScript developer so this
Let me start by saying that I do not advocate this approach, but I
Let me start out by saying that I feel like there should be a
Let me start out by saying that I am new to Java/JSP web development,
Let me start by saying I know about position() but I can't seem to
Let me start off by saying that this is my first real Cocoa app.
First off, let me start off that I am not a .net developer. The
Ok, let me start out by saying that I am brand new to MVC.
Let me start off by saying I know this is probably not the correct
Let me start of by saying that I am inexperienced with JavaScript. Here is

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.