
知识若不分享 实在没有意义 http://www.d-programming-language-china.org 20070617
点击下面网址查看原文:
http://www.d-programming-language-china.org
D语言库juno已经7个月没有更新。已经不能通过最新版DMD的编译。
试着修改能否通过DMD1.016的编译。
download juno from:
http://www.dsource.org/projects/juno
put to:\dmd\src\other\juno.
use DSSS to compile juno
\dmd\src\other\dsss.conf:
note:without -O switch, will cause Stack Overflow.
\dmd\src\other\build.bat:
run build.bat, will cause a lot of errors, fixed errors:( 本文出处: http://www.d-programming-language-china.org )
line 822,delete override.
line 155,change ref to nref,
in editor scite,search
replaced with:
line,162, changed to:
pcbRead = stream_.readBlock(cast(void*)buffer, cb);
line 163, changed to:
std.c.string.memcpy(pv, cast(void*)buffer, cb);
line,237, changed to:
std.c.string.memcpy(cast(void*)buffer, pv, cb);
line 238, changed to:
pcbWritten = stream_.writeBlock(cast(void*)buffer, cb);
line 1623, changed ref to nref,searh and replace in file.
line 1604, changed to:
*ppvObject = cast(void*)(cast(IUnknown)this);
line 1607:
*ppvObject =cast(void*)(cast(T)this);
line 1640,1641:
std.gc.removeRange(cast(void*)this);
std.c.stdlib.free(cast(void*)this);
line 554:
v.byref = cast(void*)value,
line 1590:
uint r = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, error, 0, buffer.ptr, buffer.length + 1, null);
line 1592:
return juno.base.string.toUtf8(buffer.ptr,0, r - 1);
line,1983:
char[] str = juno.base.string.toUtf8(bstr[0 .. len].ptr);
juno\xml\dom.d(60):Error: cannot create instance of abstract class XmlCDataSection
I'm no idea of how to modify line 60,62,64,66,68,74,79,81,83,85,87,89,91.
the simple solution is delete all "abstract",maybe some wrong here.( 本文出处: http://www.d-programming-language-china.org )
line 22 changed to:
return readBlock(cast(void*)buffer, buffer.length);
line 26:
return writeBlock(cast(void*)buffer, buffer.length);
line 172:
uint len = GetConsoleTitle(buffer.ptr, buffer.length);
line 96 changed to:
int cch = LCIDToLocaleName(culture, buffer.ptr, buffer.length, 0);
line 104:
int cch = DownlevelLCIDToLocaleName(culture, buffer.ptr, buffer.length, 0);
line 265 changed to:
int cch = GetLocaleInfo(culture, field, buffer.ptr, buffer.length);
line 279 changed to:
int cch = GetGeoInfo(geoId, geoType, buffer.ptr, buffer.length, 0);
line 285 changed to:
int cch = GetCalendarInfo(culture, calendar, calType, buffer.ptr, buffer.length, null);
line 326 changed to:
int cch = GetLocaleInfo(culture, field, buffer.ptr, buffer.length);
439,440 changed to:
translated = MultiByteToWideChar(CP_UTF8, 0, pChars, length, result.ptr, cch);
return result.ptr;
line 1591,1600 changed to:
return (juno.base.string.parse!(double)(s));
4109,4110 changed to:
wcscpy(tzi.StandardName.ptr, key.getStringValue("Std").toUTF16z());
wcscpy(tzi.DaylightName.ptr, key.getStringValue("Dlt").toUTF16z());
add import std.windws.charset.
line 994 changed to:
T func = cast(T)GetProcAddress(moduleHandle, std.windows.charset.toMBSz(entryPoint));
line 1012 changed to:
func = cast(T)GetProcAddress(moduleHandle, std.windows.charset.toMBSz(entryPointName));
line 951 changed to
uint r = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, error, 0, buffer.ptr, buffer.length + 1, null);
line 81,82 changed to:
RegQueryValueEx(hkey_, name.toLPStr(), null, type, b.ptr, cb);
char[] result = juno.base.string.toUtf8(b.ptr);
96,97 changed to:
RegQueryValueEx(hkey_, name.toLPStr(), null, type, b.ptr, cb);
return expandEnvironmentVariables(juno.base.string.toUtf8(b.ptr));
line 110 changed to
RegQueryValueEx(hkey_, name.toLPStr(), null, type, b.ptr, cb);
line 120 changed to
result ~= juno.base.string.toUtf8(b[index .. pos].ptr);
line 125 changed to
result ~= juno.base.string.toUtf8(b.ptr,index, end);
line 141 changed to
RegQueryValueEx(hkey_, name.toLPStr(), null, type, b.ptr, cb);
line 189 changed to
RegSetValueEx(hkey_, name.toLPStr(), 0, REG_DWORD, value.ptr, value.length);
218,line 219 changed to
RegEnumKeyEx(hkey_, i, buffer.ptr, len, null, null, null, null);
result = juno.base.string.toUtf8(buffer.ptr);
240,line 241 changed to
RegEnumValue(hkey_, i, buffer.ptr, len, null, null, null, null);
result = juno.base.string.toUtf8(buffer.ptr);
151,152 changed to:
GetTempPath(buffer.length, buffer.ptr);
return getFullPath(juno.base.string.toUtf8(buffer.ptr));
158,line 159 changed to
GetTempFileName(path.toLPStr(), "tmp", 0, buffer.ptr);
return juno.base.string.toUtf8(buffer.ptr);
164,line 165 changed to
SHGetFolderPath(Handle.init, cast(int)folder, Handle.init, 0, buffer.ptr);
return juno.base.string.toUtf8(buffer.ptr);
176,178,line 179 changed to
PathCanonicalizeW(buffer.ptr, path.toLPStr());
GetLongPathNameW(buffer.ptr, buffer.ptr, MAX_PATH);
return juno.base.string.toUtf8(buffer.ptr);( 本文出处: http://www.d-programming-language-china.org )
line 479 changed to:
char* p = cast(char*)number.digits;
line 643 changed to
char* p = cast(char*)digits.ptr;
line 915 changed to
char* p = cast(char*)digits.ptr;
line 1035 changed to
char* p = cast(char*)number.digits;
line 1099 changed to
char* p = cast(char*)number.digits;
line 1134 changed to
char* p = cast(char*)number.digits;
line 48 changed to:
const char[] demangleType = newdemangleBasicType(s);
add function(maybe some problem here):
line 115 changed to:
dispParams.rgvarg = cast(VARIANT*)varArgs;
line 14 changed to:
uint n = ExpandEnvironmentStrings(temp.toLPStr(), buffer.ptr, c);
line 18 changed to:
n = ExpandEnvironmentStrings(temp.toLPStr(), buffer.ptr, c);
line 22 changed to
int n = ExpandEnvironmentStrings(name.toLPStr(), buffer.ptr, c);
line 26 changed to
n = ExpandEnvironmentStrings(name.toLPStr(), buffer.ptr, c);
line 28 changed to
char[] result = juno.base.string.toUtf8(buffer.ptr);
line 35 changed to
int n = GetEnvironmentVariable(variable.toLPStr(), buffer.ptr, buffer.length);
line 40 changed to
n = GetEnvironmentVariable(variable.toLPStr(), buffer.ptr, buffer.length);
line 42 changed to
char[] result = juno.base.string.toUtf8(buffer.ptr);
line 205-208 changed to:
info.webName = juno.base.string.toUtf8(cp.wszWebCharset.ptr);
info.headerName = juno.base.string.toUtf8(cp.wszHeaderCharset.ptr);
info.bodyName = juno.base.string.toUtf8(cp.wszBodyCharset.ptr);
info.description = juno.base.string.toUtf8(cp.wszDescription.ptr);
line 616 changed to:
ConvertINetString(&dwMode, CP_UTF8, codePage_, cast(ubyte*)chars.ptr, &charsLength, bytes.ptr, &bytesLength);
line 630 changed to:
ConvertINetString(&dwMode, codePage_, CP_UTF8, bytes.ptr, &bytesLength, null, &charsLength);
line 633 changed to
ConvertINetString(&dwMode, codePage_, CP_UTF8, bytes.ptr, &bytesLength, cast(ubyte*)chars.ptr, &charsLength);( 本文出处: http://www.d-programming-language-china.org )
run build.bat, build juno.lib sucessed.( 本文出处: http://www.d-programming-language-china.org )
save code below to test.d:
build test.d, cause error: not found shlwapi.lib, so:
copy shlwapi.lib to \dmd\lib.
build test.d, com.base.stirng.TypeInfo_Aa cause error: com.base.string, commented TypeInfo_Aa, build test.d sucessed, but when run test.exe, will cause unhandled Error: Stack Overflow,( 本文出处: http://www.d-programming-language-china.org )
how to got when and where cause Stack Overflow?
download ddbg from:
http://ddbg.mainia.de/
copy ddbg.exe,ddbg_debug.exe to D:\d\dmd\bin.
commandline:ddbg test.exe
then input:r to run test.exe,prompt:
Unhandled Exception at juno.base.string.ArgumentList.opCall(class TypeInfo[],void*)
I'd no idea to fix this.
my simple solution is cancled "import juno.base.string" in juno.com.core, copy some function from juno.base.string to juno.com.core.( 本文出处: http://www.d-programming-language-china.org )
build test.d, prompt error:Symbol Undefined _SafeArrayGetVartype@8,search msdn, got:
change code below in juno.com.core:
to:
line 568 changed to:
changed:
to:
run build.bat:
prompt:Symbol Undefined _SafeArrayGetVartype@8
search SafeArrayGetVartype in oleaut32.lib, found nothing.
download linkdef from:
http://www.dprogramming.com/linkdef.php
build with:
then:
copy safearray.lib to \d\dm\lib, add code below to juno.com.core:
build test.d, run test.exe, send mail to gmail sucessed.
( lastupdate:20070621 最新文章请访问http://www.d-programming-language-china.org )关于一大步成功社区:
yidabu提倡在交流中学习,在分享中提高
收集感兴趣的知识,写下心得,通过网络与别人一起分享
理解一点就实践一步,收获什么就分享什么,成功就是这样一点点一步步累积起来的
网络只是一个工具,只有自己身心提高才是实实在在的。d-programming-language-china.org为大家提供一个学习交流各种知识的平台
| 欢迎光临 D语言论坛 | D programming language (http://bbs.d-programming-language-china.org/) | Powered by Discuz! 6.0.0 |