Skip to main content
gamedev.net
🔒 Locked

Static libraries.

Started by acw83 Apr 6, 2000 at 5:20 PM 2 replies 450+ views
Original Post
acw83
acw83
How can I implement a static library? I want to put my matrix functions into a Matrix.lib file and Matrix.h, I have teh code, I just need to know how to make it work as a static library...
Ranok
Ranok
Well, If your useing Visual C++ you needed to select a static link library when you create your Matrix project. Then when you compile your matrix code it will be compiled into an *.lib file. Then, you can link to that file in other projects, along with the header file, to use your static link library
---Ranok---
Pythius
Pythius
Yeah, so basically I know how to do it in VC. First, you start a project of the "Win32 Static Library" type. Then, you insert all the functionality into the project that you need. Make sure that every function you want to export to yourself from the .lib file is included in the header that''s used. Anyway, when you compile, it creates a *.lib file in the output directory. Then, whenever you want to use it you simply need to include the header file into your project, and go to your project settings and include the lib file. Then it should link in properly and all that.

Good luck!

Pythius
"The object of war is not to die for your country, but to make the other bastard die for his"
acw83
acw83
I started another project, included the first one''s header and added the .lib file to the project, but I get this error->

atTest.obj : error LNK2001: unresolved external symbol "void __cdecl MatrixMul(struct MATRIX *,struct MATRIX *,struct MATRIX *)" (?MatrixMul@@YAXPAUMATRIX@@00@Z)

Any thoughts?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.