Please help me on this, its really irritating may be because i am doing it for the first time and have no experience.
Aim : to find factorial of a number
. . STEP 1: Creating new project of type VC++ MFC and in templates MFC DLL
STEP 2: Then comes create a regular DLL (MFC shared) i say Yes
STEP 3: I create header file (ServerHeader.h) with the following code
_declspec (dllimport) int factorial(int no);
STEP 4 : I create cpp file (ServerFactorial.cpp) with the code
#include "stdafx.h"
_declspec (dllexport) int factorial(int no)
{
return no == 0 ? 1 : no * factorial(no-1);
}
STEP 5 : i BUILD the project and everything is fine
STEP 6 : I create another project Client of VC++ Win32 and in templates Win32 Console Application with application setting as EMPTY PROJECT and create a new cpp file (MainClass.cpp) with the code
#include "ServerHeader.h"
#include <iostream.h>
void main()
{
int no,i;
cout<<"Enter number";
cin>>no;
i=factorial(n); // calling the method
cout<<endl<<i; // printing ans
}
STEP 7 : I copy the ServerHeader.h, Server.dll, Server.lib (there are 2 library files, one is Object and other is Export) i copy all 4 from Server to Client
STEP 8: Right click on Client project set the linker's general setting and write the path of my lib file which i copied in Client project folder
STEP 9: i build my project i get
Error 1 fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory f:\client\client\mainclass.cpp 2 Client
Sorry for such a long post.