I have been googling for days now, and I cant seem to wrap my head around this problem.
I have a header, which exports some functions to a library. This file is called test_extern.h, and the function looks like this:
__declspec(dllexport) int aFunction(int a, int b);
I have two other files, one .h and .cpp which calculates some things with the help of the exported file. I have stripped down the versions to show what I want to do.
A.h file:
// Include CBaseDILI_J1939 header file.
class A : 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 the value of the exported function!
}
Now when I run this, I get "error LNK2019: unresolved external symbol _imp_aFunction".
I have read and read all there is about exporting dll's, is there anyone who knows what I might be doing wrong?