Archived

This topic is now archived and is closed to further replies.

acw83

Static libraries.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites