几点建议

中本聪SN-0050
其他参与者原话madhatter2原帖 ↗

有人能指点一下吗?

Can anyone shed some light here?

g++ -c -O0 -Wno-invalid-offsetof -Wformat -g -D__WXMAC__ -DNOPCH -DBUILD_MACOSX -I"/usr/include" -I"/usr/local/include/wx-2.8" -I"/usr/local/include" -I"/usr/local/boost_1_41_0" -I"/sw/include/db4" -I"/usr/local/ssl/include" -I"/usr/local/lib/wx/include/mac-ansi-release-2.8" -o headers.h.gch headers.h

g++ -c -O0 -Wno-invalid-offsetof -Wformat -g -D__WXMAC__ -DNOPCH -DBUILD_MACOSX -I"/usr/include" -I"/usr/local/include/wx-2.8" -I"/usr/local/include" -I"/usr/local/boost_1_41_0" -I"/sw/include/db4" -I"/usr/local/ssl/include" -I"/usr/local/lib/wx/include/mac-ansi-release-2.8" -o headers.h.gch headers.h

...

...

ui.h:430: error: no matching function for call to 'wxTextCtrl::SetValue(const std::basic_string, std::allocator >&)'

ui.h:430: error: no matching function for call to 'wxTextCtrl::SetValue(const std::basic_string, std::allocator >&)'

/usr/local/include/wx-2.8/wx/textctrl.h:303: note: candidates are: virtual void wxTextCtrlBase::SetValue(const wxString&)

/usr/local/include/wx-2.8/wx/textctrl.h:303: note: candidates are: virtual void wxTextCtrlBase::SetValue(const wxString&)

中本聪回应

看起来 std::string 到 wxString 的隐式转换没有正常生效。这转换到处都在用,必须能用。

It looks like the implicit conversion from std::string to wxString isn't working. That's used everywhere, the conversion needs to work.

wxString 情况复杂,因为要同时支持 win32 的 16 位 wchar 和 8 位 ansi 两种编译模式。Windows 上如果用了 "unicode"(即 wchar)构建,wxString 是 wchar 而 std::string 是 char,就会出这个问题。

wxString is complicated by supporting win32's 16-bit wchar and 8-bit ansi dual-compile. You can get that problem on Windows if the "unicode" (meaning wchar) build is used, so that wxString is wchar and std::string is char.

多半是某个 wxWidgets 编译宏或构建配置的问题。你用的 "configure" 选项是什么?

It's probably some wxWidgets compile defines or build configuration. What "configure" options did you use?

我不确定 __WXMAC__ 是不是正确的宏。也许是 Mac Classic 支持把 wxString 搞复杂了,而我们只要 OSX。试试 __WXOSX__(或见下文)

I'm not sure __WXMAC__ is the right define. It may be the Mac Classic support that's complicating wxString, and we only want OSX. Try __WXOSX__ (or see below)

"wxWidgets 有两个移植到 Mac OS 的版本。其中一个 wxMac 又分两个版本:Classic 和 Carbon。Classic 版是唯一能跑在 Mac OS 8 上的。Carbon 版既可构建为 CFM 也可构建为 Mach-O(二进制格式,类似 ELF),前者或许能在 OS 9 下运行,后者只能在 OS X 下运行。最后还有一个只能在 OS X 下使用的新 Cocoa 移植。总结一下:

"There are two wxWidgets ports to Mac OS. One of them, wxMac, exists in two versions: Classic and Carbon. The Classic version is the only one to work on Mac OS version 8. The Carbon version may be built either as CFM or Mach-O (binary format, like ELF) and the former may run under OS 9 while the latter only runs under OS X. Finally, there is a new Cocoa port which can only be used under OS X. To summarize:

* 如果要判断是否为任一 Mac 平台(classic 和 OS X),应同时检查 __WXMAC__ 和 __WXCOCOA__。

* If you want to test for all Mac platforms, classic and OS X, you should test both __WXMAC__ and __WXCOCOA__.

* 如果要判断是否为 OS X 下的任一 Mac GUI 移植版本,用 __WXOSX__。

* If you want to test for any GUI Mac port under OS X, use __WXOSX__.

* 如果要判断是否为 Mac OS X 下的任一移植版本(比如 wxGTK 以及 wxBase),用 __DARWIN__"

* If you want to test for any port under Mac OS X, including, for example, wxGTK and also wxBase, use __DARWIN__"

译文校对、修订与纠错

当前版本尚未建立逐条校对状态记录。来源核验、历史审校与当前译文校对是不同事项。

查看历史审校与代表修订 →

译文内容版本:cdc18d5f56b0。用于比对文本,不代表校对等级或更新时间。

准备纠错说明

请填写对应原文、现译文、建议译法和理由。复制后通过你联系本站作者的渠道提交;此处不会自动发送。

来源
英文原标题

A few suggestions

Bitcointalk · 原始链接 ↗ 记录编号 SN-0050

阅读字号

选择适合你的字号,之后阅读会继续使用。