Bitcointalk · Issues building bitcoin on Windows 7

中本聪,2010 年 9 月 19 日

SN-2764 已核对来源,附原文与上下文。

阅读语言
中文译文

它绊倒的那些行:

ERROR extern map<string, string> mapAddressBook;
ERROR extern CCriticalSection cs_mapAddressBook;
ERROR extern vector<unsigned char> vchDefaultKey;
OK extern bool fClient;
OK extern int nBestHeight;

OK extern unsigned int nWalletDBUpdated;
ERROR extern DbEnv dbenv;

因而它的表现就像什么都未定义,连 map 和 vector 都没有。

然而 db.h 是被 headers.h 包含的(而且仅仅在那里,别处都没有),而 headers.h 在 db.h 之前就包含了 vector、map、util.h 等等。

是不是 VC 在用预编译头并搞砸了?会不会是你目录里残留着以前失败尝试留下的预编译头文件,被它找到并使用了?

现在有一个安装包,让 MinGW 的安装变得相当简单。别用最新的 4.5.0,用往前几个版本,譬如 4.4.1(1.908.0)或 1.812.0。安装程序会完整装好一切,不像以前那么难。我记得我唯一要做的是把 make*.exe 之类的名字改成 make.exe。 http://tdm-gcc.tdragon.net/

跑题说一句:要是有人能折腾出 tcatm 的 4 路 128 位 SSE2 代码在 Windows 上可用就好了。MinGW 的优化有些问题,我不确定,兴许是栈上 16 字节对齐的问题,导致段错误。经过一番摆弄,我让他的代码在一个测试程序里跑起来了,然而不知为何在 Bitcoin 本体里不行。

ORIGINAL · 英文原文
The lines it's tripping on:
Code:
ERROR extern map<string, string> mapAddressBook;
ERROR extern CCriticalSection cs_mapAddressBook;
ERROR extern vector<unsigned char> vchDefaultKey;
OK extern bool fClient;
OK extern int nBestHeight;


OK extern unsigned int nWalletDBUpdated;
ERROR extern DbEnv dbenv;

So it's acting like nothing is defined, not even map and vector.

Yet, db.h is included by headers.h (and only there, nowhere else) which includes vector, map, util.h and everything before db.h.

Is VC trying to use precompiled headers and screwing it up?  Could there be some leftover precompiled header files in your directory from previously failed attempts that it's finding and using?

There's an installer package now that makes it really easy to install MinGW.  Don't use the latest version 4.5.0, use a few versions back like 4.4.1 (1.908.0) or 1.812.0.  A setup program completely installs everything, it's not hard like it used to be.  I think the only thing I had to do was rename make*.exe something to make.exe.
http://tdm-gcc.tdragon.net/

Off topic, but: It would be nice if someone would hack on getting tcatm's 4-way 128-bit SSE2 code working on Windows.  There's something with MinGW's optimisation, I'm not sure but maybe a problem with 16-byte alignment on the stack, that makes it segfault.  With some fiddling, I was able to get his code to work in a test program, but not in Bitcoin itself for some reason.
上下文
← 上一条 SN-2764 · 当前 下一条 → 在档案中查看完整主题串 →
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-2764