making a library
-
im trying to make myself a new library using visual studio and everything i try doesnt seem to work. i think that i got a library, but im not sure if its the right type or if i made it right. and if i did it right i have no idea which header to use or how to call my functions from each library. i understand that this is probably a hard subject to explain over a computer but any help would be greatly appreciated. thanks dudeoffrance
-
im trying to make myself a new library using visual studio and everything i try doesnt seem to work. i think that i got a library, but im not sure if its the right type or if i made it right. and if i did it right i have no idea which header to use or how to call my functions from each library. i understand that this is probably a hard subject to explain over a computer but any help would be greatly appreciated. thanks dudeoffrance
How to make a library can be ambigious. There are many types. You could have .dlls, or .libs that are directly linked into the program or just a directory of headers or even headers with source. I'd consider those all libraries. So how to make each one. To make a library which is used at runtime, use .dll. Make a new win32 application that is a dll project and then in the project you want to use the .dll, include the header to the .dll. Source is not needed, but the header will always be needed for whatever library you make. Unless you do COM or things of that nature. To make a library where no .dll is required because you wanted it linked in statically use a .lib. Create a .lib project for your library and then in the client project add the .lib to the linker tab in project settings and include the header. For the other two just make sure the client application includes and has access to the files needed. This is the simplest of libraries.
-
How to make a library can be ambigious. There are many types. You could have .dlls, or .libs that are directly linked into the program or just a directory of headers or even headers with source. I'd consider those all libraries. So how to make each one. To make a library which is used at runtime, use .dll. Make a new win32 application that is a dll project and then in the project you want to use the .dll, include the header to the .dll. Source is not needed, but the header will always be needed for whatever library you make. Unless you do COM or things of that nature. To make a library where no .dll is required because you wanted it linked in statically use a .lib. Create a .lib project for your library and then in the client project add the .lib to the linker tab in project settings and include the header. For the other two just make sure the client application includes and has access to the files needed. This is the simplest of libraries.