LNK 2019 error

Hi all

i am getting following error

error LNK2019: unresolved external symbol "public: void __thiscall Test::funa(void)" (?funa@Test@@QAEXXZ) referenced in function _main
1>C:\VISUAL_STUDIO_2010\test_exe\Debug\test_exe.exe : fatal error LNK1120: 1 unresolved externals

while trying to export class from a dll on windows xp using vs 2010

dll header Export_Class.h
1
2
3
4
5
6
7
8
9
10

class __declspec(dllexport) Test
{
	
public:
	Test(){}
	~Test(){}
	void funa(void);
};


Dll cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

void __thiscall Test::funa(void)
{
	cout<<"hello world \n";
}



exe

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

#include<iostream>
#include"Export_Class.h"
using namespace std;

int main()
{
	Test t;
	t.funa();
	return 0;
}
got it i am doing wrong steps

here is right steps

http://msdn.microsoft.com/en-us/library/ms235636.aspx
Hi ,
Is there any other way .. ? to write the dll and calling the function in the dll .
Topic archived. No new replies allowed.