|
안녕하세요
만해입니다.
어제 드뎌 셤이 끝났네요
이제 이번주 중순부터 로비작업을 크크~
어제부터
이전에 만들었던 암호화를 한번 보완해 볼려고 작업 들어 갔는데요
template <typename T> T TCrypt::XOR ( T const Operand1, T const Operand2 , int const ByteLen)
{
T Dest;
for ( int i = 0 ; i < ByteLen; i++ )
{
Dest.Bytes[i].bits.a = Operand1.Bytes[i].bits.a ^ Operand2.Bytes[i].bits.a;
Dest.Bytes[i].bits.b = Operand1.Bytes[i].bits.b ^ Operand2.Bytes[i].bits.b;
Dest.Bytes[i].bits.c = Operand1.Bytes[i].bits.c ^ Operand2.Bytes[i].bits.c;
Dest.Bytes[i].bits.d = Operand1.Bytes[i].bits.d ^ Operand2.Bytes[i].bits.d;
Dest.Bytes[i].bits.e = Operand1.Bytes[i].bits.e ^ Operand2.Bytes[i].bits.e;
Dest.Bytes[i].bits.f = Operand1.Bytes[i].bits.f ^ Operand2.Bytes[i].bits.f;
Dest.Bytes[i].bits.g = Operand1.Bytes[i].bits.g ^ Operand2.Bytes[i].bits.g;
Dest.Bytes[i].bits.h = Operand1.Bytes[i].bits.h ^ Operand2.Bytes[i].bits.h;
}
return Dest;
}
template <typename T>
T __fastcall XOR ( T const Operand1, T const Operand2 , int const ByteLen);
Data32Word_u __fastcall XOR ( Data32Word_u const Operand1 , Data32Word_u const Operand2,
int const ByteLen)
{
return XOR<Data32Word_u>(Operand1, Operand2 , ByteLen);
}
Data16Word_u __fastcall XOR ( Data16Word_u const Operand1 , Data16Word_u const Operand2,
int const ByteLen)
{
return XOR<Data16Word_u>(Operand1, Operand2 , ByteLen);
}
Data8Word_u __fastcall XOR ( Data8Word_u const Operand1 , Data8Word_u const Operand2,
int const ByteLen)
{
return XOR<Data8Word_u>(Operand1, Operand2 , ByteLen);
}
이렇게 되어 있는 소스가 있고
원래 템플릿이 아닌데 제가 한번 지정해 봤거든요
이렇게 하니깐
컴파일 단계에서는 에러가 안나는데
링크단계에서 에러가 나네요
[Linker Error] Unresolved external 'Data16Word__u TCrypt::XOR<Data16Word__u>(const Data16Word__u, const Data16Word__u, const int)' referenced from C:\PROGRAMMING\암호화\ENCRYPT.OBJ
[Linker Error] Unresolved external 'Data32Word__u TCrypt::XOR<Data32Word__u>(const Data32Word__u, const Data32Word__u, const int)' referenced from C:\PROGRAMMING\암호화\ENCODE.OBJ
[Linker Error] Unresolved external 'Data8Word__u TCrypt::XOR<Data8Word__u>(const Data8Word__u, const Data8Word__u, const int)' referenced from C:\PROGRAMMING\암호화\ENCODE.OBJ
|