Hello, this question was supposed to be as an entry in the https://bitcointalk.org/index.php?topic=1458.160
, but I am noobie, so let's hope he will see it here instead.
Anyway, I have been trying to compile the latest source downloaded from the topic ((Updated 2010-12-24), based on SVN 205), and have been having a lot of problems. And while some of them were due to my lack of knowledge and have fixed themselves as soon as I learned the right stuff, some of the problems seem to be just things that have to be fixed in the source.
I am compiling on x64 windows with MINGW. (not x64 executables, just running on a x64 os. The executables are compiled to x86 arch.)
1. I am getting very strange compile errors in src/remote/remoteminer.cpp
bitcoin-remote-rpc-20110122-src\src\remote\remoteminer.cpp:751:27: error: no match for 'operator=' in 'i = ((BitcoinMinerRemoteServer*)this)->BitcoinMinerRemoteServer::m_receiverate.std::map<_Key, _Tp, _Compare, _Alloc>::erase [with _Key = long int, _Tp = unsigned int, _Compare = std::less<long int>, _Alloc = std::allocator<std::pair<const long int, unsigned int> >, std::map<_Key, _Tp, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const long int, unsigned int> >](i)'
Assuming the author has compiled this somehow and it's not just a wrong version of the file or something, it looks to me like there are different versions of stl out there, and the one I have (in mingw) does not support = operator on stl container.
This does not look too difficult to fix, just rewrite that line in a way that doesn't use the =operator.
This is like this in just 2 places, no biggie
C:\Users\heavydist\Downloads\jelcin\build\bitcoin-remote-rpc-20110122-src\src\remote\remoteminer.cpp:929:66: error: 'getaddrinfo' was not declared in this scope
C:\Users\heavydist\Downloads\jelcin\build\bitcoin-remote-rpc-20110122-src\src\remote\remoteminer.cpp:962:22: error: 'freeaddrinfo' was not declared in this scope
After searching "the internets" something like this http://www.developpez.net/forums/d734362/c-cpp/c/getaddrinfo-was-not-declared-in-this-scope/
comes up, and so the error is easily fixed by modifying the src/headers.h file
instead of "#define _WIN32_WINNT 0x0500" insert "#define _WIN32_WINNT 0x0501" and these errors go away
but now when the compilation errors about getaddrinfo and freeaddrinfo go away, the linker cannot find them either. By looking through CMakeFiles.txt in the project I couldn't find any library that should hold these functions, so I added it
(to files cmake-bitcoin/CMakeLists.txt, cmake-bitcoind/CMakeLitst.txt and such. NOT the root CMakeLists.txt)
TARGET_LINK_LIBRARIES(bitcoin winmm.lib shlwapi.lib)
TARGET_LINK_LIBRARIES(bitcoin winmm.lib shlwapi.lib ws2_32.lib)
After that the program links just fine.
Now actually the main problem: now bitcoin.exe is produced, but cannot be run...
I get the "The application was unable to start correctly (0xc000007b)."
If that code is the standard windows error code, it's
"ERROR_INVALID_NAME 123 (0x7B) The filename, directory name, or volume label syntax is incorrect."
What could this mean? Any ideas?