Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating DLL in VC++ (Visual Studio 2008)
    primarykey
    data
    text
    <p>Please help me on this, its really irritating may be because i am doing it for the first time and have no experience. </p> <p>Aim : to find factorial of a number</p> <p>. . STEP 1: Creating new project of type VC++ MFC and in templates MFC DLL</p> <p>STEP 2: Then comes create a regular DLL (MFC shared) i say Yes</p> <p>STEP 3: I create header file (ServerHeader.h) with the following code</p> <pre><code>_declspec (dllimport) int factorial(int no); </code></pre> <p>STEP 4 : I create cpp file (ServerFactorial.cpp) with the code</p> <pre><code>#include "stdafx.h" _declspec (dllexport) int factorial(int no) { return no == 0 ? 1 : no * factorial(no-1); } </code></pre> <p>STEP 5 : i BUILD the project and everything is fine</p> <p>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</p> <pre><code>#include "ServerHeader.h" #include &lt;iostream.h&gt; void main() { int no,i; cout&lt;&lt;"Enter number"; cin&gt;&gt;no; i=factorial(n); // calling the method cout&lt;&lt;endl&lt;&lt;i; // printing ans } </code></pre> <p>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</p> <p>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</p> <p>STEP 9: i build my project i get</p> <p>Error 1 fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory f:\client\client\mainclass.cpp 2 Client</p> <p>Sorry for such a long post.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload