Can anyone tell me what's wrong with this code?
Code:
*class.h*
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <string.h>
class Decryption{
public:
Decryption();
~Decryption();
char* decrypt_line(char* buffer);
};
##################################
*class.cpp*
#include "class.h"
char* Decryption::decrypt_line(char* buffer){
//TO DO: not sure about encription type
BYTE xor_key;
for(int i=0;i<sizeof(buffer);i++){
buffer[i] = buffer[i] ^ xor_key;
}
return(buffer);
};
*main.cpp*
#include "class.h"
void main(){
Decryption *object = new Decryption;
}
It compiles fine but throw linker errors:
Code:
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Decryption::Decryption(void)" (??0Decryption@@QAE@XZ) referenced in function _main
...\Debug\main.exe : fatal error LNK1120: 1 unresolved externals
1>main - 2 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I just started writing OO code so I'm not very good at it yet.