Note that there are some explanatory texts on larger screens.

plurals
  1. POVC++ / Dev-C++: How to include an DLL?
    primarykey
    data
    text
    <p>I have written an DLL in Delphi which exports functions. I would like to use these functions in a C++ program without using dynamic Linking (LoadLibrary() API-Call).</p> <p>The "import" declaration would be</p> <pre><code>extern "C" int __stdcall getVersionNumber(); </code></pre> <p>I mainly use Bloodshed Dev-C++ which creates Windows Executables. But I do not know how to tell the compiler that it should import the function "getVersionNumber" from "STATMONDLL32.dll".</p> <p>After I spent many hours by googling the problem, without any result (there was only weird stuff written about .a files and .lib files, which I do not have compiled by Delphi...) I have also installed VC++, but even there, I could not find a way to tell the compiler to use a specific DLL.</p> <p>I have created a DEF file for this DLL - how can I tell Dev-C++ and/or VC++ to use it? (Dev-C++ prefered)</p> <p>// Edit: Delphi is creating UNDECORATED symbols. The symbol is exactly "getVersionNumber".</p> <p>I have created following DEF file with an alias for decoration:</p> <pre><code>LIBRARY STATMONDLL32 EXPORTS getVersionNumberA = _getVersionNumberA@0 </code></pre> <p>I have created a *.lib file with VC++ "lib.exe":</p> <pre><code>lib.exe /DEF:StatMonDll32.def /OUT:StatMonDll32.lib </code></pre> <p>I have included the lib in VC++ linker settings.</p> <p>But VC++ tells me that it cannot resolve the external symbol _getVersionNumberA@0 ! Please help!</p> <p>// Edit: I have uploaded the DLL here: <a href="http://www.viathinksoft.de/temp/StatMonDll32.dll" rel="nofollow">http://www.viathinksoft.de/temp/StatMonDll32.dll</a> . Can you access the symbol getVersionNumberA with VC++ ? I am searching for a solution since 6 days now :'-(</p> <p>Best regards</p> <p>Daniel Marschall</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload