If you wish to link a exe to a dll you would have to include the .dll its .lib and header;
example of the dll header:
Code:
#ifndef DLLHEADER_H_INCLUDED
#define DLLHEADER1_H_INCLUDED
#ifdef DLL_EXPORT
# define EXPORT __declspec (dllexport)
#else
# define EXPORT
#endif
extern EXPORT void Dll1 ();
#endif
Then the dll.cpp
Code:
#include "stdafx.h"
#include <iostream>
#define DLL_EXPORT//* define the export and import fuction
#include "Dll.h"
EXPORT void Dll1 () {
//*What ever your code is
}
After you have built your dll. place the .lib .dll and its header in the .exe source folder then add the header like so to your .exe:
Then for the exe you type in Dll1();
like so:
Code:
#include "stdafx.h"
#include "windows.h"
#include "Dll.h"
using namespace std;
int _tmain()
{
Dll1 ();
return 0;
}
this will then work with your dll
Bookmarks