Hi all,
I was following a tutorial on how to make .dll's since this is my first time making 1 but when i went to build the .dll i got an error saying :
definition of dllimport function not allowed
my header and source is simple :
Header.h :
#ifndef _DLL_TUTORIAL_H_
#define _DLL_TUTORIAL_H_
#include <iostream>
#if defined DLL_EXPORT
#define DECLDIR __declspec(dllexport)
#else
#define DECLDIR __declspec(dllimport)
#endif
extern "C"
{
DECLDIR int Add( int a, int b );
DECLDIR void Function( void );
}
#endif
Source.cpp
#include <iostream>
#include "tutorial.h"
#define DLL_EXPORT
extern "C"
{
DECLDIR int Add( int a, int b )
{
return( a + b );
}
DECLDIR void Function( void )
{
std::cout << "DLL Called!" << std::endl;
}
}
What am i doing wrong that i am getting this error?