joeGrammar
Programmer
Here is my DLL code
#include <iostream.h>
#if defined(DLL)
#define dllapi __declspec(dllexport)
#else
#define dllapi __declspec(dllimport)
#endif
class dllapi abstract
{
public:
abstract();
~abstract();
virtual void pvfun() = 0;
void dumbfun();
};
#if !defined (DLL)
class dllapi derived : public abstract
{
public:
derived() : abstract(){}
~derived() {}
virtual void pvfun();
};
#endif
Here is my console application code:#include "baddll.h"
#include <iostream.h>
void derived:vfun()
{
cout <<"yay";
}
int main(){
derived t;
}
Here's the error I get:
error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall derived::derived(void)" (__imp_??0derived@@QAE@XZ)
All I'm doing is trying to make an instance of the class, why am I getting this silly import error?
#include <iostream.h>
#if defined(DLL)
#define dllapi __declspec(dllexport)
#else
#define dllapi __declspec(dllimport)
#endif
class dllapi abstract
{
public:
abstract();
~abstract();
virtual void pvfun() = 0;
void dumbfun();
};
#if !defined (DLL)
class dllapi derived : public abstract
{
public:
derived() : abstract(){}
~derived() {}
virtual void pvfun();
};
#endif
Here is my console application code:#include "baddll.h"
#include <iostream.h>
void derived:vfun()
{
cout <<"yay";
}
int main(){
derived t;
}
Here's the error I get:
error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall derived::derived(void)" (__imp_??0derived@@QAE@XZ)
All I'm doing is trying to make an instance of the class, why am I getting this silly import error?