Export (0) Print
Expand All
Expand Minimize

Compiler Error C2491

'identifier' : definition of dllimport function not allowed

Data, static data members, and functions can be declared as dllimports but not defined as dllimports.

The following sample generates C2491:

// C2491.cpp
// compile with: /c
// function definition
void __declspec(dllimport) funcB() {}   // C2491

// function declaration
void __declspec(dllimport) funcB();   // OK

Community Additions

ADD
Show:
© 2014 Microsoft