Menu

Call DLL from dev-cpp/mingw

Guidance
2002-11-17
2012-09-26
  • Guidance

    Guidance - 2002-11-17

    I want to let WinIO library (http://internals.com/) work with dev-cpp/mingw, but there's a link problem since it's a DLL written for MSVC. I checked mingw faq,  http://mingw.sourceforge.net/mingwfaq.shtml#faq-msvcdll , it's really too complex for me to understand and follow. Can it be built into dev-cpp IDE project options to dramatically ease this procedure -- just like a simple DECLARE statement in VB is the only thing we need to do to interface with a DLL?

     
    • Trev L Nunes

      Trev L Nunes - 2002-11-17

      Just as a note: This is the wrong forum for this question. Address general programming/linking questions to C/C++ message boards. 

      There is a distinction between a declaration of an interface and the actual link process. There are several good websites that discuss linking:
      http://webclub.kcom.ne.jp/ma/colinp/win32/tools/link.html

      http://cs3.ecok.edu:457/cgi-bin/getnav/tools/ccs_linkedit_dynamic_interface.html

      Shared or Dynamic

      A DLL is a shared library and this means the linker has to be given an address offset to indicate the offsets into the library to access a function. Your executable 'references' the DLL/shared library and the Kernel ( Windows ) loads the appropriate library. Your executable remains small.

      Static ( fixed )

      To build something 'into dev-cpp IDE project' means to assemble with statically linked libraries. The main difference being the address offsets and information to construct the executable are completely contained in the library. Your executable 'grows' because the library is added to your executable. 

      The library comes with the source code BTW.Yoy should be able to build the DLL yourself and link after it's built. To access the provided DLL...

      Put the DLL into dev-cpp/lib along with the .lib file ( which is the information for calculating offsets into the library )

      In your project options:

      -lWinIo -lC:/dev-cpp/lib/WinIo.lib

      In your code perhaps you need function calls to : dlopen dlclose etc.

       
      • Hayama

        Hayama - 2007-09-12

        1.Install mingw-utils
        2.Use reimp to generate .a file.
        reimp winio.lib
        3.In your project options: (linker)
        -lwinio

        4.ok

         
    • Nobody/Anonymous

      Oops I made a mistake.Drop the -l for the lib path...

      -lWinIo C:/dev-cpp/lib/WinIo.lib

      or whereever WinIo is installed.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.