Static Library

I have created a static library project.I have included two files one isheader and second is c++ file.

There is only one function.Please tell me how i can use library in my other project.

Please give all steps.
malik_mumtazAsked:
Who is Participating?
 
CriusConnect With a Mentor Commented:
1) In your other project, go to project->settings, and under the link tab, type in your library name and location into the objects/library modules edit control.

2) Include the header file into any source in which you want to use the library function.
0
 
DanRollinsConnect With a Mentor Commented:
or place this inside one of the source files of the other project:

#pragma comment(lib,"yourlibraryname.lib")

Also the .LIB file should be located where the linker will find it.  I'll explain if you ask.

-- Dan

0
 
malik_mumtazAuthor Commented:
hello crius

i have done this and when i call a member function of the library "undefined function" comes.Please tellif there is next option.
0
 
CriusCommented:
Include the header file into any source in which you want to use the library function.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.