I was following the example, but doesn't work, how can I fix this? error msg:
error LNK2019: unresolved external symbol "public: void __thiscall CWin::show_member(void)" (?show_member@CWin@@QAEXXZ) referenced in function _wmain c:...\TEST_DOMAIN_MODULE.obj
error LNK1120: 1 unresolved externals c:...\TEST_DOMAIN_MODULE.exe 1
// A_DOMAIN_MODULE.h
#pragma once
#include <iostream>
using namespace std;
class CWin
{
private:
char id;
int width, height;
public:
CWin(char i,int w,int h):id(i),width(w),height(h) {}
void show_member(void);
};
// A_DOMAIN_MODULE.cpp
#include "stdafx.h"
#include "A_DOMAIN_MODULE.h"
void CWin::show_member(void)
{
cout << "Window " << id << ": ";
cout << "width=" << width << ", height=" << height << endl;
}
// TEST_DOMAIN_MODULE.cpp
#include "stdafx.h"
#include "../A_DOMAIN_MODULE/A_DOMAIN_MODULE.h"
int main()
{
CWin win1('A',50,40);
win1.show_member();
system("pause");
return 0;
}