what if i have an already compiled DLL and i want to import its functions in a devc++ program...could someone please tell me how?
i'm having some issues in running Portaudio libraries with Devc++,does anyone know if Devc++ really supports this tipe of audio libraries?
thank you,nicholas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-07-10
Normally when you build a DLL it has the components:
1) A header file declaring the prototypes of the functions or classes in the library.
2) A static export library that must be linked to your executable
3) The DLL itself.
There are some gotchas:
1) The export library must be GCC object file format rather than say Borland or Microsoft. Microsoft export libraries can be converted using the reimp tool. GCC export libraries normally have a .a ('a' for archive) extension rather than a .lib extension of most Windows development tools.
2) If the Library contains C++ interfaces it will not work unless it was built with a tool using the same mangling scheme as the compiler you are using (probably MinGW/GCC being the Dev-C++ default).
If the DLL has a C interface but you have no export library, or cannot convert one, then you can programatically access the library at runtime by using the Win32 LoadLibrary() API.
If you have the library source, then it may be easiest to rebuild from source.
Note if you are referencing some third party component which those who might help may never have heard of, it is a good idea to post a link to what you are referring to (and where there is more than one specifically which download you are using). I presume you are referring to http://www.portaudio.com/, which is open source, so you can build a compatible version. This page (found by doing a Google site search for "MinGW" at http://www.portaudio.com ) http://www.portaudio.com/trac/wiki/TutorialDir/Compile/WindowsMinGW show you how to do it. You will need a more complete installation of MinGW that the subset provided by Dev-C++ (available from www.mingw.org ) and specifically you will need to issue the commands at the MSYS command shell rather than Windows' CMD shell.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
what if i have an already compiled DLL and i want to import its functions in a devc++ program...could someone please tell me how?
i'm having some issues in running Portaudio libraries with Devc++,does anyone know if Devc++ really supports this tipe of audio libraries?
thank you,nicholas
Normally when you build a DLL it has the components:
1) A header file declaring the prototypes of the functions or classes in the library.
2) A static export library that must be linked to your executable
3) The DLL itself.
There are some gotchas:
1) The export library must be GCC object file format rather than say Borland or Microsoft. Microsoft export libraries can be converted using the reimp tool. GCC export libraries normally have a .a ('a' for archive) extension rather than a .lib extension of most Windows development tools.
2) If the Library contains C++ interfaces it will not work unless it was built with a tool using the same mangling scheme as the compiler you are using (probably MinGW/GCC being the Dev-C++ default).
If the DLL has a C interface but you have no export library, or cannot convert one, then you can programatically access the library at runtime by using the Win32 LoadLibrary() API.
If you have the library source, then it may be easiest to rebuild from source.
Note if you are referencing some third party component which those who might help may never have heard of, it is a good idea to post a link to what you are referring to (and where there is more than one specifically which download you are using). I presume you are referring to http://www.portaudio.com/, which is open source, so you can build a compatible version. This page (found by doing a Google site search for "MinGW" at http://www.portaudio.com ) http://www.portaudio.com/trac/wiki/TutorialDir/Compile/WindowsMinGW show you how to do it. You will need a more complete installation of MinGW that the subset provided by Dev-C++ (available from www.mingw.org ) and specifically you will need to issue the commands at the MSYS command shell rather than Windows' CMD shell.
Clifford