#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Right Coast
    Posts
    25
    Rep Power
    0

    making a library? DLL or .o file


    Hi,

    I am very solid in ANSI/ISO C and C++, but know very little proprietary library-oriented and API stuff (like the UNIX APIs for sockets and pipes or true Win32 programming).

    I have long searched casually on bookstore shelves and the net for a simple introduction into the process.

    I have learned MFC to some degree for making windows programs and gave tk a casual glance in Linux.

    Okay, my question:

    Do you know where I can find a good starting place to learn more about doing the following?

    1) make a library in unix that I can dynamically bind to. This would be the notion of haveing a .h file and a .c or .cpp file that provides an implementation for the interface described in the .h file. I would then be able to compile a .o that can be used so long as the .h file is present?

    2) Making DLLs. I believe this is roughly the windows equivalent of what I am getting at in point #1 above.

    Again, I am strong in my ANSI/ISO-level skillset that covers the core of both C and C++, but need to move to the next level by learning things like making libraries. I really don't care for Windows programming as MS code looks really weird to me (LPSTR and that kinda thing).

    Anyhow, if anyone has a nice nudge for me in the proper direction I would be grateful and I promise to RTFM as soon as I can find out where the FM is on these topics.

    Thanks very much,

    J
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    For question 1, see http://sources.redhat.com/autobook/a...l#SEC_Contents and check out chapters 10 and 17.

    For question 2, it entirely depends on what language/tool you're using to create the DLL (Delphi, C++ Builder, Visual C++ etc.) The end result (i.e.) the compiled DLL has the same format, so a DLL written in one language can be accessed by a program written in another language. However, the method/syntax to create them depends on the language/environment.
    In Delphi, you would do something like this: http://delphi.about.com/library/weekly/aa041100a.htm
    In C++ Builder:
    http://www.visualcomponentlibrary.com/bcb/dll.htm

    Hope this helps! :)
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Right Coast
    Posts
    25
    Rep Power
    0

    Thanks Scorps


    Eddie Rulez!

    BTW, do you have any info on making the DLL the VC++ way?

    Thanks a million!

    J
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    For Visual C++, see http://msdn.microsoft.com/library/de...ur_Program.asp

    Better still, you might want to go ahead and buy a book. Most books on Visual C++ have at least one or two chapters devoted to DLL creation.

IMN logo majestic logo threadwatch logo seochat tools logo