Convert static lib to import lib/DLL
-
I have a static lib that we no longer can find the source code for. We want to continue to use the library, but have problems with it in the context of Visual Studio 2005. It uses I/O routines that are no longer supported. I would like to build a mini DLL around this library exposing the functions from the library that we use, but I'm not sure how to do this. I have a static library and an include file that contains export statements for the library. I thought about using dumpbin to get the symbols out of the library, but there are a lot of symbols and I'm not sure what out of the symbols I'm suppose to pull for a .def file. Any one have ideas?
Mike
-
I have a static lib that we no longer can find the source code for. We want to continue to use the library, but have problems with it in the context of Visual Studio 2005. It uses I/O routines that are no longer supported. I would like to build a mini DLL around this library exposing the functions from the library that we use, but I'm not sure how to do this. I have a static library and an include file that contains export statements for the library. I thought about using dumpbin to get the symbols out of the library, but there are a lot of symbols and I'm not sure what out of the symbols I'm suppose to pull for a .def file. Any one have ideas?
Mike
wrote:
I have a static library and an include file that contains export statements for the library. I thought about using dumpbin to get the symbols out of the library, but there are a lot of symbols and I'm not sure what out of the symbols I'm suppose to pull for a .def file.
you only need the names (and declarations) of the functions and variables you're going to actually use.... right ?
image processing toolkits | batch image processing | blogging
-
I have a static lib that we no longer can find the source code for. We want to continue to use the library, but have problems with it in the context of Visual Studio 2005. It uses I/O routines that are no longer supported. I would like to build a mini DLL around this library exposing the functions from the library that we use, but I'm not sure how to do this. I have a static library and an include file that contains export statements for the library. I thought about using dumpbin to get the symbols out of the library, but there are a lot of symbols and I'm not sure what out of the symbols I'm suppose to pull for a .def file. Any one have ideas?
Mike
Hi I know that there are some products that convert DLL to lib, but in your case I think you rigth with your idea. The steps could be the following: 1. Build a new dll project in vs2005. 2. In your stdafx.cpp add #pragma comment(lib,"mylib.lib") 3. Include your .lib header file in the project. 4. Declare the new functions, maybe with new names. I expect this steps help you Regards David Leyva
-
wrote:
I have a static library and an include file that contains export statements for the library. I thought about using dumpbin to get the symbols out of the library, but there are a lot of symbols and I'm not sure what out of the symbols I'm suppose to pull for a .def file.
you only need the names (and declarations) of the functions and variables you're going to actually use.... right ?
image processing toolkits | batch image processing | blogging
Correct. The static library is already in use and could be used as is in Visual Studio 6.0. However, with changes made in Visual Studio 2003 and above to remove the _io routines, I can no longer link the static libary directly into VS2005. To solve this I assume that I can create a wrapper DLL/import lib on top of the static lib using Visual Studio 6.0, but I'm not sure I understand what I need to do to accomplish this. I only wish to expose the functions that I use. There are about 40 of them.
Mike
-
Correct. The static library is already in use and could be used as is in Visual Studio 6.0. However, with changes made in Visual Studio 2003 and above to remove the _io routines, I can no longer link the static libary directly into VS2005. To solve this I assume that I can create a wrapper DLL/import lib on top of the static lib using Visual Studio 6.0, but I'm not sure I understand what I need to do to accomplish this. I only wish to expose the functions that I use. There are about 40 of them.
Mike
here's how i usually do it: first, create a "DLL that exports some symbols" project in VC6. for each function you want to export from the DLL, write a function that goes like this:
Whatever_API_return_Type MyDLLFunction1(params)
{
return MyLibFunction1(params);
}
Whatever_API return_Type MyDLLFunction2(params)
{
return MyLibFunction2(params);
}
etc.then write headers for those functions:
_Whatever_API return_Type MyDLLFunction1(params);
_Whatever_API return_Type MyDLLFunction2(params);
...
_Whatever_API return_Type MyDLLFunction40(params);build the DLL, being sure to set the proper #define flag to turn on function exporting (see the main header file for your DLL project). then replace all your MyLibFunction* calls with the corresponding MyDLLFunction* call. link to the DLL's static lib, and that's that...
image processing toolkits | batch image processing | blogging
-
here's how i usually do it: first, create a "DLL that exports some symbols" project in VC6. for each function you want to export from the DLL, write a function that goes like this:
Whatever_API_return_Type MyDLLFunction1(params)
{
return MyLibFunction1(params);
}
Whatever_API return_Type MyDLLFunction2(params)
{
return MyLibFunction2(params);
}
etc.then write headers for those functions:
_Whatever_API return_Type MyDLLFunction1(params);
_Whatever_API return_Type MyDLLFunction2(params);
...
_Whatever_API return_Type MyDLLFunction40(params);build the DLL, being sure to set the proper #define flag to turn on function exporting (see the main header file for your DLL project). then replace all your MyLibFunction* calls with the corresponding MyDLLFunction* call. link to the DLL's static lib, and that's that...
image processing toolkits | batch image processing | blogging