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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:37:03+00:00 2026-05-26T14:37:03+00:00

i did these steps and make shared library. but here i have some questions

  • 0

i did these steps and make shared library.
but here i have some questions

  1. i want know why we write 4 and 5 steps.

    i know only that these steps is used for link library

  2. in 6th step why we use only lhuffman insted of libhuffman

steps:

1 gcc -c -fPIC filebits.c -o filebits.o
2 gcc -shared -Wl,-soname,libhuff.so.1 -o libhuffman.so.1.0.1 filebits.o
3 mv libhuffman.so.1.0.1 /home/mydesktop/slib/
4 ln -sf /home/mydesktop/slib/libhuffman.so.1.0.1  /home/mydesktop/slib/libhuffman.so
5 ln -sf /home/mydesktop/slib/libhuffman.so.1.0.1  /home/mydesktop/slib/libhuffman.so.1
6 gcc -o app app.c -lhuffman
7 ./app

please explain me these steps

  • 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-26T14:37:04+00:00Added an answer on May 26, 2026 at 2:37 pm
     1. i want know why we write 4 and 5 steps.
    

    In step 4 you are creating a soft link to the library name which is looked up by the linker to link.
    In step 5 you are creating a soft link to the library indicating its major version. There is no need for you to follow these steps as such instead you can generate libhuffman.so as the output in the first step which is what the linker looks up for. But this convention is followed so that library’s major & minor versions are tracked easily. Generally, library has the name as library_name.MAJOR_VERSION.MINOR_VERSION. There is soft link to that in the form of library_name.MAJOR_VERSION & another soft link with just library_name. library_name is in the form of lib[library_name].so as that is format expected by the linker when using -l option. You can check libraries on your Linux PC you will see this convention being followed in a lot of cases. This link provides some details regarding this.

    2.in 6th step why we use only lhuffman insted of libhuffman
    

    GCC linker adds lib & .a (or .so) to the library name which is specified with -l option.
    Hope this helps!

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

Sidebar

Related Questions

In c#, we have interfaces. Where did these come from? They didn't exist in
Did not have luck with these examples: Javascript File remove Javascript FSO DeleteFile Method
Why did MS originally make the decision to maintain these two separate core libs?
I've tried these, and they did not work (Access opens, but it does not
I'm trying to make a C shared library. I'm a newbie in Matlab, so
[Note: There is another thread about this problem but it did not answer the
I did some HTTP monitoring with WireShark. Are there more tools like this that
I have an idea for a simple program to make that will help me
I'm trying to make a dice game in Flash/ActioScript 3. I did all the
I have some queries that are taking too long (300ms) now that the DB

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.