[...]
mingw32-g++.exe -LD:\Projects\GeccoTester\ -L..\ptypes-2.0.2\lib -L"d:\Program Files\CodeBlocks\lib" -LD:\Projects\ptypes-2.0.2\lib -o D:\Projects\GeccoTester\GeccoTester.exe .objs\protocol.o .objs\sha256.o .objs\main.o ..\ptypes-2.0.2\lib\libptypes.a
.objs\protocol.o: In function `ZN21AccountRequestMessage6assignEPKcj':
D:/Projects/GeccoTester/protocol.cpp:58: undefined reference to `sha256_starts(sha256_context*)'
D:/Projects/GeccoTester/protocol.cpp:59: undefined reference to `sha256_update(sha256_context*, unsigned char*, unsigned long)'
D:/Projects/GeccoTester/protocol.cpp:60: undefined reference to `sha256_finish(sha256_context*, unsigned char*)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
3 errors, 0 warnings
Those errors basically mean "
AccountRequestMessage::assign(char const*, unsigned int) is using three functions that have been declared but aren't defined in any (linked) object file".
Judging by their names, I'd assume they were supposed to be in sha256.cpp. See if they are defined there, and if their signature is
exactly the same (incuding constness etc.).
Another possibility that just occurred to me: these look like C functions (sha256_ prefix, char*'s). If they're actually defined in a .c file, that might also explain it: C++ uses a different naming scheme than C by default. The fix would be to either rename the file to have an extension associated with C++ (.cpp is the most popular AFAIK), specify '-x c++' as an additional command-line option for these files, or change the header associated with it to be similar to this:
#ifndef SOME_HEADER_GUARD
#define SOME_HEADER_GUARD
#ifdef __cplusplus
extern "C" {
#endif
/* * * The rest of the original header * * */
#ifdef __cplusplus
} // extern "C"
#endif
#endif // SOME_HEADER_GUARD
(you can also put
extern "C" in front of each and every declaration your C++ program uses, but that's probably more work)