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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:11:15+00:00 2026-06-14T09:11:15+00:00

Why does double declaration of structs causes a compilation error , while double definitions

  • 0

Why does double declaration of structs causes a compilation error, while double definitions of functions causes a linking error?

  • 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-14T09:11:16+00:00Added an answer on June 14, 2026 at 9:11 am

    Because functions definitions are included in executable at link time but decalration or syntax check all are done at compile time

    Consider one thing also when you are calling any function and compiler is not able to find the declaration of function then it will generate warning as implicit declaration of func().

    To remove this warning message we provide forward declaration of func,int func(); and it compiled without any warning message.

    Do you think why does this happen ? It happens because compiler did not find that func()symbol. It’s all upto the compiler to make code error free according to the Grammar of the Language.

    But building of final executable is done at link time and then linker started looking for function defition of func() , If found then fine and if not .. then Linker error

    could not have resolved external symbol _func()

    Note: any external symbols are resolved at link time

    On gcc for only compilation use this : (this may vary according to compiler)

    gcc -Werror -c test.c –> It will generate test.o file

    then try to link it and make executable

    gcc -Werror -o test test.o –> test is executable

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

Sidebar

Related Questions

What does the following function perform? public static double CleanAngle(double angle) { while (angle
While double-clicking the text of a QTreeView expands the children, a single-click does not.
In double (*foo)[2] what does the [2] represent? And how would I convert an
Does the following statement holds for any double (Java primitive double precision IEEE-754) except
Microsoft J++ does not have a Double.parseDouble() method. How do I do this?
Does 9patch image work on windows 7 x64? I double click on draw9patch.bat on
Does someone knows why the mysql_real_escape_string() function adds three backslashes before quotes, or double
Does android supports log2 ? I already find that android doesnt support long double.
Why does the following code throw ArrayStoreException ? double[] a = {2.0,3.4,3.6,2.7,5.6}; int[] b
Winforms - why does a Show() after a system tray double click end up

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.