DLL linking in Watcom

This is a discussion on DLL linking in Watcom within the Windows Programming forums, part of the Platform Specific Boards category; Hello all, Basically I'm pretty clueless about DLLs. I know the theory, it's just linking to the functions in the ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    38

    Question DLL linking in Watcom

    Hello all,

    Basically I'm pretty clueless about DLLs. I know the theory, it's just linking to the functions in the DLL and using them that has me baffled.

    This is my first attempt to do this, and it is proving to be more difficult than I imagined. I think part of my problem may be some strange name mangling on Watcom's part.

    But what I really need is an overview of what is required to link to a DLL and utilize it. How is it usually done? What are my options?

    I'll ask more specific questions later.
    Links to pertinent information always welcome.


    ________
    Rutabega
    Last edited by Rutabega; 11-20-2006 at 10:24 AM.

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,451
    with each dll an lib file is supplied.

    you link this file as if it is static library.
    That's all. The only difference from using static library - this supplied lib file does not contain actual functions, but for the caller this is of no interest
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    38
    I am linking the .lib file, and including the .h file where appropriate. Yet I still get an 'undefined reference' error when linking. I don't think Watcom is able to match up the names of the exported .dll functions to what it is expecting them to be called...

    ________
    Rutabega

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    38
    After trying everything I could think of to get this to link, I gave up.

    However, I did manage to get this to work by using LoadLibrary() and GetProcAddress().
    I then call the functions by using their address. Seems to work so far; will test tonight when I can actually hook up the hardware and see results.


    ________
    Rutabega

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. linking to my own DLL
    By yahn in forum C++ Programming
    Replies: 19
    Last Post: 10-13-2008, 07:59 PM
  2. resources on linking to a dll
    By Luciferek in forum C++ Programming
    Replies: 4
    Last Post: 07-30-2008, 11:22 AM
  3. Replies: 0
    Last Post: 06-03-2007, 02:35 AM
  4. Linking a DLL
    By ThorntonReed in forum C Programming
    Replies: 3
    Last Post: 04-29-2006, 10:00 AM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 04:29 AM

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