Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Dynamic Loading of my DLL with Static Lib in Windows Environment

$
0
0

I am writing my problem that works in Linux and Mac. The Windows OS has been a nightmare for me.

Here is the scenario…

I created a static library that is created with /MT run-time library setting. Call it A1.lib. This library contains many functions.

I created a DLL that is created with /MT run-time library setting. Call it B1.dll and B1.lib. This DLL calls some functions that are defined in A1.lib. When creating this DLL, I had to link it with the static library A1.lib as Windows doesn't allow deferring linking to a static library for references in a DLL.

Now, I want to test this DLL with the static library, i.e. B1.dll and A1.lib respectively in a test program. I created a visual studio project with /MT run-time library setting. I used the dynamic loading of the dll by using the GetProcAddress functions etc. that work properly... There are no problems in compiling and linking. But when I execute, it looks like the objects are disconnected. The object that is initialized once does not seem to be initialized when the DLL functions are being called.  

Please help!


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>