| | |
linking problems
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2006
Posts: 2
Reputation:
Solved Threads: 0
md5.cpp
md5.h
I get this error
[Linker error] undefined reference to `MD5String(char*)'
Help please
C++ Syntax (Toggle Plain Text)
#include <cstdlib> #include <iostream> #include <string> #include <stdio.h> #include "md5.h" using namespace std; char* szString = "Some string you want to generate an MD5 key for."; int main(int argc, char *argv[]) { char* sString = MD5String(szString); cout << "Some string you want to generate an MD5 key for." << "MD5 Output: " << sString; system("PAUSE"); return EXIT_SUCCESS; }
md5.h
C++ Syntax (Toggle Plain Text)
typedef unsigned int uint4; typedef unsigned short int uint2; typedef unsigned char uchar; char* PrintMD5(uchar md5Digest[16]); char* MD5String(char* szString); char* MD5File(char* szFilename); class md5 { public: md5() { Init(); } void Init(); void Update(uchar* chInput, uint4 nInputLen); void Finalize(); uchar* Digest() { return m_Digest; } private: void Transform(uchar* block); void Encode(uchar* dest, uint4* src, uint4 nLength); void Decode(uint4* dest, uchar* src, uint4 nLength); inline uint4 rotate_left(uint4 x, uint4 n) { return ((x << n) | (x >> (32-n))); } inline uint4 F(uint4 x, uint4 y, uint4 z) { return ((x & y) | (~x & z)); } inline uint4 G(uint4 x, uint4 y, uint4 z) { return ((x & z) | (y & ~z)); } inline uint4 H(uint4 x, uint4 y, uint4 z) { return (x ^ y ^ z); } inline uint4 I(uint4 x, uint4 y, uint4 z) { return (y ^ (x | ~z)); } inline void FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) { a += F(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } inline void GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) { a += G(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } inline void HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) { a += H(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } inline void II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) { a += I(b, c, d) + x + ac; a = rotate_left(a, s); a += b; } private: uint4 m_State[4]; uint4 m_Count[2]; uchar m_Buffer[64]; uchar m_Digest[16]; uchar m_Finalized; };
I get this error
[Linker error] undefined reference to `MD5String(char*)'
Help please
Last edited by Ripiz; Aug 12th, 2006 at 12:06 pm.
It would be really better if you start from the basics rather than jumping in the middle of nowhere. If you dont understand the code there is no point in makin it run.
Still if you want the working code, you can try a new implementation of the MD5 algorithm HERE.
Hope it helped,
Bye.
Still if you want the working code, you can try a new implementation of the MD5 algorithm HERE.
Hope it helped,
Bye.
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Similar Threads
- linking error (C++)
- CSS External Linking Problems (HTML and CSS)
- Compile and linking problems with Microsoft Visual C++ (C++)
- buffer (C)
Other Threads in the C++ Forum
- Previous Thread: Deleting this pointer
- Next Thread: WinSock problems.
Views: 1016 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int integer java lib library linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project python random read recursion recursive reference return sort stream string strings struct studio system template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






