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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:25:08+00:00 2026-06-03T04:25:08+00:00

First off, I have only really used Objective-c methods in my programming. I decided

  • 0

First off, I have only really used Objective-c methods in my programming. I decided to do a couple of quick math calculations as c functions and then ended up needing them for multiple classes. So then I stuck the c functions in a separate .h file. This works fine until I try and import the .h file into more than one class. Then I get this error:

Duplicate Symbol *_myFunction* blah blah blah Linker command failed
with exit code 1 (use -v to see invocation)

How can I use a c function in more than one class without this link error. I’ve tried just defining the functions in the classes I need them in, but it seems that even if they are different classes, I get this error if the function name is the same. I’m probably crazy here, but some help understanding would be great.

  • 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-03T04:25:09+00:00Added an answer on June 3, 2026 at 4:25 am

    You should put declarations in the .h file, make them extern, and move definitions into a .c or .m file.

    From this

    myfunctions.h

    int max(int a, int b) {
        return a>b ? a : b;
    }
    

    Move to this:

    myfunctions.h

    extern int max(int a, int b); // declaration
    

    myfunctions.c

    int max(int a, int b) {
        return a>b ? a : b;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I should say that I don't have any experience in working with
First off thanks to all the users who have made my android developing adventure
First off - apologies for the poor title, I have no idea how to
First off, I'm aware this is a bad practice and I have answered many
First off, let me clarify the platforms we are using. We have an ASP.NET
First off, I'm new to Java, so please be gentle. I have a JFrame
I have two questions, actaully... First off, Why cant I do this: List<Object> object
first, I can't stand Crystal! Okay, that's off my chest... Now, we have an
First off, I have read through a list of postings on this topic and
First off, I am only now familiar with with the issues with regard to

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.