Dll File

Hi ALl,

I am trying to test a .Dll file I wrote, but have the following error:

TestDllB.obj : error LNK2019: unresolved external symbol "public: static double __cdecl MathFunctions::calcInvNorm(double)" (?calcInvNorm@MathFunctions@@SANN@Z) referenced in function _main

My Main Function

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include "MathFuncsDLL.h"

using namespace std;


int main(void){

	double c=MathFunctions::calcInvNorm(0.5);
	cout<<c;

return 0;

}


My Dll header file

1
2
3
4
5
6
7
8
9
10
11
12
13
14

#pragma once
#include <math.h>

class MathFunctions
{
private:
	const static double EWMALamda;
public:
    MathFunctions(void);
    ~MathFunctions(void);
    static __declspec(dllexport) double calcInvNorm(double d);
}



Any Advices?

Thanks
In order to use the function you need to change dllexport to dllimport and then provide the linker the path of your lib file. And since you are meddling with exporting classes, you must use the same compiler for both the DLL and the test executable.
Topic archived. No new replies allowed.