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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:21:42+00:00 2026-05-24T13:21:42+00:00

I am developing an application in C. I want to use a local function

  • 0

I am developing an application in C. I want to use a local function with the same name in more than one source files. Let me simplify the issue:

In hell.c

void myLocalFunc(){ printf("Hello hell\r\n"); }

In world.c

void myLocalFunc(){ printf("Hello world\r\n"); }

Because they are local functions only, i dont declare them in header files. But when i compile the project, it gives me “Multiple definition of ‘myLocalFunc'” error message and also this one: “Multiple definition of ‘myLocalFunc’ (first defined here)”.

What is my mistake here?

  • 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-24T13:21:42+00:00Added an answer on May 24, 2026 at 1:21 pm

    Replace it with

    static void myLocalFunc(){ printf("Hello world\r\n"); }
    

    Or, if you’re using C++, you can also use an anonymous namespace like this:

    namespace {
    void myLocalFunc(){ printf("Hello world\r\n"); }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam developing one application.In that i want to use the Amazon S3 service.I got
I'm developing a web application I want to use the role authentication to control
I am developing an application in which I want to use push notification service.
I am developing an ASP.NET MVC application and I want to use OpenId. What
I'm developing an XBAP application in C# and want to be able to use
I am developing a java application and I want to use: Reporting Analysis Data
I am developing an application in which I want to use an NSDictionary .
Hi every body i am developing a MVC application, and i want to use
I´m developing an ASP.NET Web Application and want to use the ASP.NET Routing Engine
I am thinking of developing a Silverlight application and want to make use of

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.