Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dllimport error

Status
Not open for further replies.

joeGrammar

Programmer
Jun 4, 2001
162
CA
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 &quot;baddll.h&quot;
#include <iostream.h>

void derived::pvfun()
{
cout <<&quot;yay&quot;;
}


int main(){

derived t;
}

Here's the error I get:

error LNK2001: unresolved external symbol &quot;__declspec(dllimport) public: __thiscall derived::derived(void)&quot; (__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?

 
why do yoou need there dllapi for derived if anyway it is not visible in your dll? John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top