import - Using a C++-function that is exported -
this question has answer here:
- c++ exporting , using dll function 2 answers
i have been googling days now, , cant seem wrap head around problem.
i have header, exports functions library. file called test_extern.h, , function looks this:
__declspec(dllexport) int afunction(int a, int b);
i have 2 other files, 1 .h , .cpp calculates things of exported file. have stripped down versions show want do.
a.h file:
// include cbasedili_j1939 header file. class : public cbasedili_j1939 { public: int bfunction(int a, int b); }
a.cpp file:
#include "test_extern.h" #include "a.h" int a::bfunction(int a, int b) { return afunction(a, b); // return value of exported function! }
now when run this, "error lnk2019: unresolved external symbol _imp_afunction".
i have read , read there exporting dll's, there knows might doing wrong?
you have declare dll function in calling module dllspec(dllimport).
Comments
Post a Comment