By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,942 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,942 IT Pros & Developers. It's quick & easy.

How to create a library in C++

P: 79
How do I create my own library in C++?
Nov 15 '08 #1
Share this Question
Share on Google+
4 Replies


Banfa
Expert Mod 5K+
P: 8,916
That depends entirely on the platform you are using.
Nov 15 '08 #2

weaknessforcats
Expert Mod 5K+
P: 9,197
In the case of Windows where you might be using Visual Studio.NET, you create a WIN32 project and whenthe wizard appears, select Application Settings. In that dialog, check static library. Then click Finish.

Your project build result will be a .lib file.
Nov 16 '08 #3

P: 79
In the case of Windows where you might be using Visual Studio.NET, you create a WIN32 project and whenthe wizard appears, select Application Settings. In that dialog, check static library. Then click Finish.

Your project build result will be a .lib file.
I'm sorry, I haven't a clue what you're talking about. All I want is to create a library in C++ V5.02. If you know how can you explain it step by step?
And I am using windows.
Nov 16 '08 #4

Banfa
Expert Mod 5K+
P: 8,916
Do you mean Visual C++ v5.02 ? (Or may be Borland C++ v5.02). There are no google hits on Microsoft C++ V5.02.

In the case of Visual C++ it is as weaknessforcats stated, when you create a project you need to look for the "static library" project type, then you will create a project that produces a library (.lib)

If you are using the command line then there is a switch to the linker that instructs it to create a library (.lib) rather than an executable, for your version I believe you should be using either the command lines
link32 -lib <arguments>
or
lib32 <arguments>
Since Visual Studio 2005 this has become
lib <arguments>
Nov 16 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.