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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:24:44+00:00 2026-05-23T07:24:44+00:00

While compiling a C program, gcc links the standard C library by default. Is

  • 0

While compiling a C program, gcc links the standard C library by default. Is it possible to link only the selected functions, say printf instead of the complete C standard library, in an attempt to reduce the size of the executable to a bare minimum?

  • 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-23T07:24:45+00:00Added an answer on May 23, 2026 at 7:24 am

    With most traditional linkers static library linking is done on an object file basis. gcc will normally use the system linker on the system that you are using.

    Traditionally a static library is just an archive file consisting of the object files that form the library. When you link a static library into your program the linker will extract any object files from the library that help resolve any unresolved symbols in your program, including those introduced by object files from the library that helped resolve previously unresolved symbols.

    In theory, if the standard library implementation consisted of one object file per function and there were no depedencies between the standard library functions then you would only get just the functions that you explicitly called. In practice, you are likely to get more functions than you explicitly call included.

    Dynamic linking is completely different. In this case your program will simply contain a reference to the standard library shared object which will be loaded in its entirety into your processes memory space at run time.

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

Sidebar

Related Questions

While compiling my program which is using libevent library I am using gcc option
What we are looking for is: while compiling the same configuration, say Release|Win32, is
I am new to linux, while compiling with dynamic library I am getting the
I've been trying a program from codeproject , about ptr_vector, and while compiling, the
Possible Duplicate: How to write program during compiling? I found this problem on a
While compiling a Visual Studio 2010 program, I included the python2.5 directory. In the
I learned that compiler will expand macros while compiling. Templates are also expanded at
I am having issues with usage of log10f(). I am compiling the program on
I have this error while compiling my Visual C++ project in Visual Studio 2008
Hi I am getting the following Linking error while compiling ConvolutionFFT2D from CUDA src

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.