static link libraries
-
Hi, I have a dll project but I no longer want to send the dll to the customer. Instead I want to send a lib file that the customer can link to in their projects (instead of loading the dll as they do today). 1. is there a way to convert the dll project into a static library? if so how? 2. If not, I presume I have to create a new static library project from scratch using New Project w32 static lib. Right? 3. If I have to create a new static lib proj, how do I "export" the functions from the projects so they are available for the customer that will link the lib? Thanks!!!
-
Hi, I have a dll project but I no longer want to send the dll to the customer. Instead I want to send a lib file that the customer can link to in their projects (instead of loading the dll as they do today). 1. is there a way to convert the dll project into a static library? if so how? 2. If not, I presume I have to create a new static library project from scratch using New Project w32 static lib. Right? 3. If I have to create a new static lib proj, how do I "export" the functions from the projects so they are available for the customer that will link the lib? Thanks!!!
ackabacka wrote: 3. If I have to create a new static lib proj, how do I "export" the functions from the projects so they are available for the customer that will link the lib? You don't have to do anything. The LIB is essentially like an OBJ file when it comes to linking, the LIB has the compiled version of your code, and the linker will search it for functions that your client calls. -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!
-
ackabacka wrote: 3. If I have to create a new static lib proj, how do I "export" the functions from the projects so they are available for the customer that will link the lib? You don't have to do anything. The LIB is essentially like an OBJ file when it comes to linking, the LIB has the compiled version of your code, and the linker will search it for functions that your client calls. -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!
Michael Dunn wrote: You don't have to do anything. The LIB is essentially like an OBJ file when it comes to linking, the LIB has the compiled version of your code, and the linker will search it for functions that your client calls. OK thanks. I've now created a new static library project and (re) created all functions, as it didn't seem possible to change any setting for the dll project to have it compile a static library (or is it?). It works fine for me, but now I wonder, who can use this library? It doesn't use MFC. Sure, it will only run on intel compatible computers running Windows but what else is required. Of course another VC++ 6 developer could use it (as it's compiled under VC++ v6), but what if the developer is using VC++ .NET environment, with or without managed C++? What if the developer is using another c++ compiler (Intel, Borland etc)? Anyone?
-
Michael Dunn wrote: You don't have to do anything. The LIB is essentially like an OBJ file when it comes to linking, the LIB has the compiled version of your code, and the linker will search it for functions that your client calls. OK thanks. I've now created a new static library project and (re) created all functions, as it didn't seem possible to change any setting for the dll project to have it compile a static library (or is it?). It works fine for me, but now I wonder, who can use this library? It doesn't use MFC. Sure, it will only run on intel compatible computers running Windows but what else is required. Of course another VC++ 6 developer could use it (as it's compiled under VC++ v6), but what if the developer is using VC++ .NET environment, with or without managed C++? What if the developer is using another c++ compiler (Intel, Borland etc)? Anyone?
When you compile the code as C++, the LIB can only be used by compilers that understand the VC name decoration scheme. VC 6 and 7.x do so, as does the Intel compiler. There may be others as well, but those are the only ones I've used. -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!
-
When you compile the code as C++, the LIB can only be used by compilers that understand the VC name decoration scheme. VC 6 and 7.x do so, as does the Intel compiler. There may be others as well, but those are the only ones I've used. -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!
OK, thanks. Actually no classes are availble from "outside". The Lib has a static class (not a class with static functions but a static implemented class), and only plain functions (that calls member functions of the static class) are available from outside (which prototypes are declared in the .h file that I send to the customer). Does this make it possible to use it from even more compilers? If not, is there perhaps a way to mark these functions as "C" functions? Thanks!