I have created a dll and I want to use its functions in my other projects using Visual Studio 2008.Kindly Help...:icon_sad:

Initially in the dll project I was using .c code and had used

#ifdef __cplusplus 
extern "C"
{
  __declspec(dllexport) void MyFunctionName();
}
#endif

in both the .h and .c files. Why cannot say but the solution was not generating the .lib But, when i commented the same and compiled the dll project the .lib also got generated and I can use it conveniently.
When searched further found that the syntax I was using is incorrect, it should be as follows...

#ifdef __cplusplus 
extern "C"
{
#endif
  __declspec(dllexport) void MyFunctionName();
#ifdef __cplusplus 
extern "C"
}
#endif

This code works fine and gives the .dll as well as .lib(object file library):icon_lol:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.