Home Man
Search
Today's Posts
Register

Post questions about C, C++, Java, SQL, and other programming languages here.

Conditions/suggestions to use shared library in C/C++ coding

Tags
c c++, coding practices, linker, programming, shared library

👤 Login to reply

 
Thread Tools Search this Thread
# 8  
Old 05-18-2018
Quote:
Originally Posted by yifangt
Never tried dissection of the executable code from source code. However, this is not what I want to learn.
"What does a compiler and linker do?", and "How do executables work?" are pretty much the same question. An intimate knowledge of assembly language isn't required, though. Do you remember those old choose-your-own-adventure books? "If you say yes, go to page 37, if you say no, go to page 17", etc?

Imagine trying to write one of those. You would not write "go to page 37" in your draft - you have no idea what page 37 will be, that's your publisher's job. So you write "go to 'grisly death page'".

The publisher sets out all your pages in arbitrary order. They must make sure the beginning goes first, but otherwise the order really doesn't matter since the reader is supposed to jump around anyway. They number each page. And lastly, they change every reference to 'grisly death page' into 'page 37'.

That's exactly what a linker does, except it numbers by bytes, not pages.

If you want to add compilation to this analogy, just imagine that your publisher is Russian, and makes you send all your writing to a translator first.

Last edited by Corona688; 05-18-2018 at 12:57 PM..
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Add shared members from library to same library in a different directory kneemoe AIX 5 08-25-2012 08:21 AM
Shared library with acces to shared memory. iamjag Programming 5 06-18-2012 02:52 PM
How to change a Makefile from building static library to shared library? cpthk Shell Programming and Scripting 1 08-26-2009 02:23 AM
shared library on QNX ReeV UNIX for Advanced & Expert Users 1 05-06-2009 05:30 AM
Suggestions/Recommendations for coding Ariean Shell Programming and Scripting 0 01-22-2009 12:05 PM
Shared memory for shared library otheus Programming 0 09-03-2008 03:55 AM
Shared memory in shared library DreamWarrior Programming 12 05-30-2007 04:33 PM
shared library areef4u UNIX for Advanced & Expert Users 1 08-01-2006 02:14 AM
Shared Library Problem vinz HP-UX 1 08-27-2004 10:57 AM
Shared Library rajashekaran Programming 2 08-03-2002 01:59 PM


All times are GMT -4. The time now is 03:18 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password