View previous topic :: View next topic |
Author |
Message |
mico75
Joined: 28 Oct 2008 Posts: 5
|
Posted: Tue Oct 28, 2008 3:43 am Post subject: Tutorial using Dwin |
|
|
Hi,
I am new in D programming and Dwin. I made this script:
Code: |
import tango.io.Stdout;
import dwin.sys.win32.Registry;
void main()
{
char[] result;
scope httpkey = RegistryKey.classesRoot.openSubKey(r"HTTP\shell\open\command");
if(httpkey !is null)
{
result = httpkey.getValue!(char[])(null);
Stdout(result).newline;
}
else
Stdout("failed").newline;
}
|
I got this error:
C:\Dm\learn>dmd dwin_registry.d
OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin3sys5win328CodePage11toString16zFAaZPu
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _RegQueryValueExW@24
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin4text7convert3Utf8toStringFPuZAa
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin3sys5win327Wrapper24expandEnvironmentStringsF
AaZAa
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin3sys5win328Registry11RegistryKey11classesRoot
C4dwin3sys5win328Registry11RegistryKey
--- errorlevel 5
So, I did something wrong . Any tutorial/manual using Dwin?
regards,
Mico |
|
Back to top |
|
|
yidabu
Joined: 21 Apr 2007 Posts: 87
|
Posted: Tue Oct 28, 2008 6:05 am Post subject: |
|
|
I tested the scripts, and it works fine.
You can build a static dwin.lib first, then link the libary:
Code: | pragma(lib, "dwin.lib"); |
_________________ D yuyan |
|
Back to top |
|
|
mico75
Joined: 28 Oct 2008 Posts: 5
|
Posted: Tue Oct 28, 2008 11:33 am Post subject: Error 42: Symbol Undefined |
|
|
yidabu wrote: | I tested the scripts, and it works fine.
You can build a static dwin.lib first, then link the libary:
Code: | pragma(lib, "dwin.lib"); |
|
Hi,
still did not work. This what I did:
1. Unzip dwin in C:\Dm\dwin
2. Copy dsss.conf from dwin folder to C:\Dm
3. Run: dsss build dwin (built static lib)
4. Copy dwin.lib to C:\Dm\tango\lib (tango is in C:\Dm\tango)
5. Copy dwin subfolder inside dsss_imports to C:\Dm\tango\import
6. Made the script, and put the pragma line
7. Run the script: dmd thescript.d
8. Got the error:
Error 42: Symbol Undefined _RegQueryValueExW@24
C:\Dm\tango\bin\..\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _RegCloseKey@4
.
.
.
(several similar error messages)
Note: I am using Win Vista
Did I make something wrong?
regards,
Mico |
|
Back to top |
|
|
yidabu
Joined: 21 Apr 2007 Posts: 87
|
Posted: Tue Oct 28, 2008 4:47 pm Post subject: |
|
|
It's may be a DMD configuration issue, check the dmd/bin/sc.ini settings. _________________ D yuyan |
|
Back to top |
|
|
mico75
Joined: 28 Oct 2008 Posts: 5
|
Posted: Tue Oct 28, 2008 8:13 pm Post subject: |
|
|
yidabu wrote: | It's may be a DMD configuration issue, check the dmd/bin/sc.ini settings. |
My sc.ini:
[Version]
version=7.51 Build 020
[Environment]
; LIB=%@P%\..\lib;\dm\lib
LIB="%@P%\..\import\lib;%@P%\..\lib;%@P%\..\..\dm\lib"
;DFLAGS="-I%HOME%\common" "-I%HOME%\.."
DFLAGS="-I%@P%\..\import" -version=Tango -defaultlib=tango-base-dmd -debuglib=tango-base-dmd
LINKCMD=%@P%\..\..\dm\bin\link.exe
regards,
Mico |
|
Back to top |
|
|
mico75
Joined: 28 Oct 2008 Posts: 5
|
Posted: Wed Oct 29, 2008 4:00 am Post subject: D Installation |
|
|
yidabu wrote: | I tested the scripts, and it works fine.
You can build a static dwin.lib first, then link the libary:
Code: | pragma(lib, "dwin.lib"); |
|
Hi, I just wondering how your arrangement of D tools in your machine. And how you tested Dwin.
regards,
Mico |
|
Back to top |
|
|
yidabu
Joined: 21 Apr 2007 Posts: 87
|
Posted: Thu Oct 30, 2008 11:07 pm Post subject: |
|
|
or use DWin recent trunk ?
I tested you code with DWin trunk, DMD 1.036, Tango recent trunk on Windows XP. _________________ D yuyan |
|
Back to top |
|
|
|