Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Importing a DLL into a static library

$
0
0

So, i have a DLL that i have tested and i am able to use it. (i do not have the source code, only the .lib and the .dll ).

I would like to create a wrapper around the functions and make a static library of it.

Creating a static library works fine, although if i use any of the functions in the DLL it does not work.

The header for the DLL is something like this:

#ifdef __cplusplus

extern "C"

#endif

#ifdef WIN32 //<< this one is true

#define __API __declspec(dllimport)

#else

#define __API extern

#endif

__API void function_I_would_like_to_use();

I am using VS2012.

So in my project settings i have added the .lib under addition dependencies.

However, how can i tell the compiler to also include the DLL?

As of now it compiles fine , but obviusly i still need the DLL since the functions i would like to use are defined as 

dllimport.  

Is it possible to import from the DLL and then export it to the static library?

Thx in advance


Viewing all articles
Browse latest Browse all 15302

Trending Articles



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