Note that there are some explanatory texts on larger screens.

plurals
  1. POutilizing a static library to create an import library
    text
    copied!<p>I am interested in using my static lib to create a dll (implicitly linking). which means I need to (in vs2008) create a dll project that should generate the following:</p> <ol> <li>header file (which have export function declarations. These are simple wrappers to actual functions in the static lib using __declspec(dllexport) which are in the .cpp )</li> <li>import lib which will be made as a result of creating the dll</li> <li>the actual dll which is created.</li> </ol> <p>I have made a test program that will utilize the above dll(including the import lib/header files) to test it. in this I have included all the three items. now the exe compiles/links without issue. however in the main.cpp when i call the exported functions (with the associated __declspec(dllimport) call it never seems to execute. I am uncertain why this is? Its almost like the even though the exe can see the exported function in in the dll...the dll cannot call on the code that is in the static lib? </p> <p>i just cannot answer why my exe can't see the code in the static lib? do i need an archiver/librarian for vs2008 to include all those obj files as part of the import lib? I am at a loss and am not sure how to test this? </p> <p>other than just making my static lib directly into a dll. I wanted to try this method. I know i am missing something...i have read all over the place and i am just stuck. There were some threads here that had some people posting something similar but i can't seem to get it. please be as detailed as possible as I am new to this. thanks again.</p> <p>update 1: ok so currently i added the extern line to the function prototype and now it sees the exported function from the dll. however, now the only issue left is that: </p> <p>i can't invoke the function that this exported function (aka wrapper) is trying to call. which happens to be in the static library. how should my exe get visibility to that static library function. I know it can be done because I think there was one other person on this board who was able to make this work. </p> <p>update 2: my setup is exactly like this questioner... <a href="https://stackoverflow.com/questions/2991927/how-to-force-inclusion-of-an-object-file-in-a-static-library-when-linking-into-e">How to force inclusion of an object file in a static library when linking into executable?</a></p> <p>but i am not using explicit linking. i am using implicit linking. my real issue is how to call a static lib function in my dll wrapper which is exported to the exe?</p>
 

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