DWT用不了。。郁闷。。指点一下啊,各位高手。
hohoyeh
2007-10-16
新手,也不怕笑话了,在群里没人理我。。唉。。
简单的拿DWT的一个最简单的HELLO来试手,结果就受打击了。。 module hello2; import dwt.all; version(build){ debug{ pragma(link, "dwtd.lib"); }else{ pragma(link, "dwt.lib"); } pragma(link, "advapi32.lib"); pragma(link, "comctl32.lib"); pragma(link, "gdi32.lib"); pragma(link, "shell32.lib"); pragma(link, "comdlg32.lib"); pragma(link, "ole32.lib"); pragma(link, "uuid.lib"); pragma(link, "phobos.lib"); pragma(link, "user32_dwt.lib"); pragma(link, "imm32_dwt.lib"); pragma(link, "shell32_dwt.lib"); pragma(link, "msimg32_dwt.lib"); pragma(link, "gdi32_dwt.lib"); pragma(link, "kernel32_dwt.lib"); pragma(link, "usp10_dwt.lib"); pragma(link, "olepro32_dwt.lib"); pragma(link, "oleaut32_dwt.lib"); pragma(link, "oleacc_dwt.lib"); } class Hello { private Shell shell; public Shell open(Display display) { shell = new Shell(display); shell.setText("Hello world"); shell.setSize(400, 250); shell.setLayout(new FillLayout()); Button btn = new Button(shell, DWT.PUSH); btn.setText("Hello, DWT"); btn.handleEvent(this, DWT.Selection, &onButtonClick); with(new Button(shell, DWT.PUSH)) { setText("Button 2"); // embeded delegate handleEvent(this, DWT.Selection, delegate(Event e){ // Use Event.cData (means custom data) to pass argument Hello pthis = cast(Hello)e.cData; MessageBox.showMsg("You clicked button 2", null, pthis.shell); }); } shell.open(); return shell; } // click event handler private void onButtonClick(Event e) { MessageBox.showMessage("You clicked hello button", "Information", shell); } public static void run() { Display display = Display.getDefault(); Hello hello = new Hello(); Shell shell = hello.open(display); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } void main(char[][] args) { try { Hello.run(); }catch(Object o){ MessageBox.showMsg(o.toString()); } } Command >>> Building Project: HelloDLang...... C:\dmd\dmd\bin\dmd.exe D:\DProjects\HelloDLang\objs\dwttest.obj -ofHelloDLang -IC:\dmd\DWT\import C:\dmd\dmd\lib\dwtd.lib C:\dmd\dmd\lib\dwt.lib -odobjs -O -release C:\dmd\dmd\bin\..\..\dm\bin\link.exe D:\DProjects\HelloDLang\objs\dwttest,HelloDLang,,C:\dmd\dmd\lib\dwtd.lib+C:\dmd\dmd\lib\dwt.lib+user32+kernel32/noi; OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmCreateContext@0 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmAssociateContext@8 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _CreateSolidBrush@4 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _GetObjectW@12 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _DeleteObject@4 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmGetContext@4 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmGetOpenStatus@4 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmGetConversionStatus@12 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmReleaseContext@8 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmDestroyContext@4 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _SelectPalette@12 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _RealizePalette@4 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmSetOpenStatus@8 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _ImmSetConversionStatus@12 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _CreateRectRgn@16 C:\dmd\dmd\lib\dwtd.lib(shell) Error 42: Symbol Undefined _CombineRgn@16 C:\dmd\dmd\lib\dwtd.lib(button) Error 42: Symbol Undefined _SelectObject@8 C:\dmd\dmd\lib\dwtd.lib(button) Error 42: Symbol Undefined _GetTextMetricsW@8 C:\dmd\dmd\lib\dwtd.lib(display) Error 42: Symbol Undefined _RegOpenKeyExW@20 C:\dmd\dmd\lib\dwtd.lib(display) Error 42: Symbol Undefined _RegQueryValueExW@24 C:\dmd\dmd\lib\dwtd.lib(display) Error 42: Symbol Undefined _RegCloseKey@4 C:\dmd\dmd\lib\dwtd.lib(display) Error 42: Symbol Undefined _CreateFontIndirectW@4 C:\dmd\dmd\lib\dwtd.lib(display) Error 42: Symbol Undefined _GetStockObject@4 C:\dmd\dmd\lib\dwtd.lib(widget) Error 42: Symbol Undefined _InitCommonControls@0 C:\dmd\dmd\lib\dwtd.lib(os) Error 42: Symbol Undefined _OleInitialize@4 C:\dmd\dmd\lib\dwtd.lib(control) Error 42: Symbol Undefined _SetBkColor@8 C:\dmd\dmd\lib\dwtd.lib(control) Error 42: Symbol Undefined _SetTextColor@8 C:\dmd\dmd\lib\dwtd.lib(control) Error 42: Symbol Undefined _GetLayout@4 C:\dmd\dmd\lib\dwtd.lib(composite) Error 42: Symbol Undefined _RestoreDC@8 C:\dmd\dmd\lib\dwtd.lib(composite) Error 42: Symbol Undefined _SaveDC@4 C:\dmd\dmd\lib\dwtd.lib(composite) Error 42: Symbol Undefined _GetRegionData@12 C:\dmd\dmd\lib\dwtd.lib(device) Error 42: Symbol Undefined _CreatePalette@4 C:\dmd\dmd\lib\dwtd.lib(device) Error 42: Symbol Undefined _GetSystemPaletteEntries@16 C:\dmd\dmd\lib\dwtd.lib(device) Error 42: Symbol Undefined _GetDeviceCaps@8 C:\dmd\dmd\lib\dwtd.lib(device) Error 42: Symbol Undefined _ScriptGetProperties@8 C:\dmd\dmd\lib\dwtd.lib(device) Error 42: Symbol Undefined _GdiSetBatchLimit@4 C:\dmd\dmd\lib\dwtd.lib(device) Error 42: Symbol Undefined _EnumFontFamiliesW@16 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_GetImageCount@4 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_SetIconSize@12 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_GetIconSize@12 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_AddMasked@12 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_Add@12 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_Replace@16 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_ReplaceIcon@12 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _CreateCompatibleDC@4 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _CreateCompatibleBitmap@12 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _SetStretchBltMode@8 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _StretchBlt@44 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _BitBlt@36 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _DeleteDC@4 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _CreateBitmap@20 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _PatBlt@24 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_Destroy@4 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_Remove@8 C:\dmd\dmd\lib\dwtd.lib(imagelist) Error 42: Symbol Undefined _ImageList_Create@20 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetClipRgn@8 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetRgnBox@8 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _CreateDIBSection@24 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _Arc@36 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetPixel@12 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _OffsetRgn@12 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _SelectClipRgn@8 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _SetROP2@8 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetDIBColorTable@16 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _SetDIBColorTable@16 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetDIBits@28 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _MoveToEx@16 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _LineTo@12 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetTextColor@4 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _SetPixel@16 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _Ellipse@20 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _Polygon@12 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _Polyline@12 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _Rectangle@20 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _RoundRect@28 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetROP2@4 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _SetBkMode@8 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _ExtTextOutW@32 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetTextExtentPoint32W@16 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetCurrentObject@8 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetBkColor@4 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _Pie@36 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GradientFill@24 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetCharWidthW@16 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetCharABCWidthsW@16 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetClipBox@8 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _SetRectRgn@20 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _GetRandomRgn@12 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _CreatePen@12 C:\dmd\dmd\lib\dwtd.lib(gc) Error 42: Symbol Undefined _SetLayout@8 C:\dmd\dmd\lib\dwtd.lib(image) Error 42: Symbol Undefined _GetPaletteEntries@16 C:\dmd\dmd\lib\dwtd.lib(color) Error 42: Symbol Undefined _GetNearestPaletteIndex@8 C:\dmd\dmd\lib\dwtd.lib(color) Error 42: Symbol Undefined _SetPaletteEntries@16 C:\dmd\dmd\lib\dwtd.lib(accessible) Error 42: Symbol Undefined _CreateStdAccessibleObject@16 C:\dmd\dmd\lib\dwtd.lib(accessible) Error 42: Symbol Undefined _LresultFromObject@12 C:\dmd\dmd\lib\dwtd.lib(accessible) Error 42: Symbol Undefined _IsEqualGUID@8 C:\dmd\dmd\lib\dwtd.lib(converter) Error 42: Symbol Undefined _SysStringByteLen@4 C:\dmd\dmd\lib\dwtd.lib(converter) Error 42: Symbol Undefined _SysFreeString@4 C:\dmd\dmd\lib\dwtd.lib(accessible) Error 42: Symbol Undefined _SysAllocString@4 C:\dmd\dmd\lib\dwtd.lib(fontdata) Error 42: Symbol Undefined _TranslateCharsetInfo@12 C:\dmd\dmd\lib\dwtd.lib(trayitem) Error 42: Symbol Undefined _Shell_NotifyIconW@8 C:\dmd\dmd\bin\..\lib\phobos.lib(com) Error 42: Symbol Undefined _IID_IUnknown --- errorlevel 102 Finished |
|
oldrev
2007-10-16
DWT,又是DWT.......
为什么这个一年多没人维护的死项目就有这么大的吸引力? |
|
oldrev
2007-10-16
GUI库有的是,什么 DFL,MinWin 都是不错的库,为什么非要用 DWT?实在想用 SWT 的话 Java 是更好的选择。
|
|
hohoyeh
2007-10-16
一个很大的理由就是,我们现在所有的Poseidon这个D语言专用的IDE就是用D + DWT 写的。
|
|
tomqyp
2007-10-17
把DWT/lib目录下的库都放到link可以找到的目录,或者像dwtd.lib一样在编译时显式的把这些库加到编译参数里去
|
|
sw2wolf
2007-10-17
http://dlang.group.iteye.com/group/topic/3157
|
|
ideage
2007-10-17
dwt是可以使用的。上面的错误是没有连接必要的lib库。
|
|
ant-man
2007-10-17
为什么不用wxD
虽然编译后的文件比较大 但是跨平台,而且他的兼容性很强大的... |
|
kuan
2007-10-23
繁體中文不知道是否可以正常顯示??
樓主應該是使用poseidon編譯,請使用bud編譯的選項,另外已經使用預定義(pragma)聯結程式庫,在poseidon的專案選項就不必重複聲明連結dwt.lib及dwtd.lib,而且兩者應該是擇一連結. 如果要用DMD編譯,請把預定義的pragma(link, "*.*")改為pragma(lib, "*.*"). |
|
oldrev
2007-10-23
wow,欢迎对岸爱好者加入。
|