Thread: DLL programming

  1. #1
    Registered User
    Join Date
    Sep 2007

    DLL programming

    Hi. I'm just starting out in programming a video game DLL. Once I get the first version compiled and running I think I'll be fine, but I need a little help right now. Through online tutorials, I've compiled a (hopefully) working "test.dll", and my program can find it, but I don't know the code to link and execute a test function in the DLL. Can anyone give me a hand? Is there a website that goes over how to program a DLL? Thanks.

    I'm working on Dev-C++ version 4, running on Windows XP.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Here's one of many threads you'll find by searching these forums.


  3. #3
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    When you create a DLL project, and compile it, it will produce 2 files in the release folder. One will be named test.dll and the other will be test.lib. You link test.lib to your application's project under the settign for additional libraries and then have test.dll in the same directory as YourGame.exe. The lib file produced automagically handles loading the DLL at runtime. There is a manual way to load the DLL functions, but I dont recommend it, especially since you have the lib already compiled for you.

    Actually I just noticed you said you are using Dev-C++, it still produces a library file just as VS does, but it has a different extension. I think its .a instead of .lib it should be in the same directory that the DLL was compiled into.
    Last edited by abachler; 09-11-2007 at 12:09 PM.

  4. #4
    Registered User
    Join Date
    Sep 2007
    Many thanks. I've found "maindll.o" , now how do I link it to Dev-C++ ?

    I tried menu:Options->Compiler Options->Add the following commands when calling compiler ,

    but don't know the syntax for adding a library. "maindll.o" "-lmaindll.o" "-l maindll.o" and "-maindll.o" all didn't work. What am I doing wrong?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  3. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM
  4. Using class with DLL
    By greg2 in forum C++ Programming
    Replies: 2
    Last Post: 09-12-2003, 05:24 AM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM