Learn more about compiling, linking and...

This is a discussion on Learn more about compiling, linking and... within the C++ Programming forums, part of the General Programming Boards category; I would like to learn more about prosess of compiling and linking (under the hood). Build proces. Libs and dlls. ...

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    3

    Learn more about compiling, linking and...

    I would like to learn more about prosess of compiling and linking (under the hood). Build proces. Libs and dlls. Stuff like that. Any articles or books to recomend?

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    Every compiler is different. You need to read the docs for the specific compiler you want to use. You mention "dlls", so I gather from that that you mean the MS-Windows operating system, because *nix does not use dlls. google for "how to create a dll" and you will find some information. There are lots of books at your local bookstore about how to use Microsoft Visual Studio 2003 and probably also Borland products.

    As for in-depth coverage -- there isn't really all that much to it. Probably the most interesting one is the preprocessor, because that's where all macros are expanced.

    preprocessor -- expands all include files and macros. This produces intermediate file, with VC++ 6.0 they have a *.i file name. You can request the compiler stop after this stage by using the /P compiler switch so that you can read the *.i files -- they are just text files very similar to the original *.c and *.cpp files.

    compiler -- takes the *.i files and compiles them down to *.obj files.

    linker -- combines all *.obj and *.lib files into the *.exe program.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    *.obj
    Or *.o, for some compilers.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    Quote Originally Posted by dwks
    Or *.o, for some compilers.
    also, *.a instead of *.lib on those same *nix-compatible compilers

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    197
    and its .so (shared object) on most *nix that support it instead of dll (Dynamicly linked library)
    If any part of my post is incorrect, please correct me.

    This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.

  6. #6
    Registered User
    Join Date
    Apr 2005
    Posts
    3
    Thanks people. Here is the thing. I'm trying to learn more then theory, some practical things. And now I see a lot of stuff you can't realy find in those "learn ... in 21 days" books.

    things like static and dynamic linking?
    i have some basic idea about lib (so) files but i'm not realy understanding what is happening under?
    dll export stuff like: extern "C" __declspec(dllexport)?

    Just need links to articles, keywords or book names... thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how long to learn c programming
    By cmay in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 05-13-2009, 01:55 AM
  2. What do I learn now?
    By Lorgon Jortle in forum C++ Programming
    Replies: 14
    Last Post: 03-14-2009, 07:44 PM
  3. Novice trying to learn C++
    By dead in forum C++ Programming
    Replies: 10
    Last Post: 12-01-2003, 09:25 PM
  4. Linking error!
    By m712 in forum C++ Programming
    Replies: 2
    Last Post: 12-08-2002, 11:24 PM
  5. Boreland - Linking Error
    By pecymanski in forum C++ Programming
    Replies: 1
    Last Post: 09-14-2001, 01:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21