FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dwin.lib(Registry) Error 42: Symbol Undefined _HKEY_*

 
Post new topic   Reply to topic     Forum Index -> DWin
View previous topic :: View next topic  
Author Message
warker



Joined: 14 Dec 2007
Posts: 4

PostPosted: Fri Dec 14, 2007 4:14 pm    Post subject: dwin.lib(Registry) Error 42: Symbol Undefined _HKEY_* Reply with quote

hello,

i got this error everytime i'm trying to use Dwin .. all compiles fine
but the linker sais
Quote:
OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_CLASSES_ROOT
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_PERFORMANCE_DATA
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_CURRENT_USER
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_LOCAL_MACHINE
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_USERS
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_CURRENT_CONFIG
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_DYN_DATA
--- errorlevel 7


I'm using Tango 0.99.3 dmd 1.023 and build dwin with "dsss build dwin"
i also linked advapi32.lib (dm) and (selfbuild) win32.lib (latest stable)

the code i tried is

Code:
module install;

private import dwin.sys.win32.Registry;
private import dwin.io.SpecPath;

private import tango.io.Console; // DEBUG

class install{

   this(){
      Cout(dwin.io.SpecPath.desktopPath()).newline;
      Cout(dwin.io.SpecPath.exeDir()).newline;
      Cout(dwin.io.SpecPath.startupPath()).newline;
      Cout(dwin.io.SpecPath.systemPath()).newline;
      Cout(dwin.io.SpecPath.windowsPath()).newline;
      Cout(dwin.io.SpecPath.profilePath()).newline;

   }
   
}


I build dwin before i build win32.lib

I also saw that the HKEY_LOCAL_MACHINE and so on is declared in the WindowsAPI winreg.d which is compiled into the win32.lib .. so i dont recognize the problem thrown while linking ..

greeting Warker
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Fri Dec 14, 2007 5:33 pm    Post subject: Reply with quote

please download svn snap, and build program with Tango.
Back to top
View user's profile Send private message
warker



Joined: 14 Dec 2007
Posts: 4

PostPosted: Sat Dec 15, 2007 6:23 am    Post subject: Reply with quote

downloaded an compiled the svn from dwin .. the error is the same ..


used libs
advapi32.lib (dm)
win32.lib (win32 WindowsAPI project)
dwin.lib (revision 84)

all with tango 0.99.3 + dmd 1.023

Quote:

OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_CLASSES_ROOT
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_PERFORMANCE_DATA
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_CURRENT_USER
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_LOCAL_MACHINE
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_USERS
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_CURRENT_CONFIG
C:\d\dmd\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _HKEY_DYN_DATA
--- errorlevel 7


Code:
module install;

private import dwin.sys.win32.Registry;
private import dwin.sys.win32.SpecPath;

private import tango.io.Console; // DEBUG

class install{

   this(){
      Cout(dwin.sys.win32.SpecPath.desktopPath()).newline;
      Cout(dwin.sys.win32.SpecPath.startupPath()).newline;
      
   }
   
}


did i forgot something? Question
Back to top
View user's profile Send private message
warker



Joined: 14 Dec 2007
Posts: 4

PostPosted: Sat Dec 15, 2007 8:34 am    Post subject: SOLVED Reply with quote

I solved the problem by adding
Code:

const HKEY
   HKEY_CLASSES_ROOT     = cast(HKEY) 0x80000000,
   HKEY_CURRENT_USER     = cast(HKEY) 0x80000001,
   HKEY_LOCAL_MACHINE    = cast(HKEY) 0x80000002,
   HKEY_USERS            = cast(HKEY) 0x80000003,
   HKEY_PERFORMANCE_DATA = cast(HKEY) 0x80000004,
   HKEY_CURRENT_CONFIG   = cast(HKEY) 0x80000005,
   HKEY_DYN_DATA         = cast(HKEY) 0x80000006;


to the Registry.d
and build the dwin.lib again

(got the code from winreg.d of the WindowsAPI project)
http://www.dsource.org/projects/bindings/wiki/WindowsApi
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Sat Dec 15, 2007 8:14 pm    Post subject: Reply with quote

I build this code, no error happen:

Code:
module test;

private import dwin.sys.win32.SpecPath;

private import tango.io.Console; // DEBUG

pragma(lib, "tango-base-dmd.lib");
pragma(lib, "tango-user-dmd.lib");
pragma(lib, "dwin.lib");

void main(char[][] args)
{
      Cout(dwin.sys.win32.SpecPath.desktopPath()).newline;
      Cout(dwin.sys.win32.SpecPath.startupPath()).newline;     
}


dwin.sys.win32.UserGdi defined:

Quote:
extern final HANDLE HKEY_CLASSES_ROOT;
extern final HANDLE HKEY_CURRENT_USER;
extern final HANDLE HKEY_LOCAL_MACHINE;
extern final HANDLE HKEY_USERS;
extern final HANDLE HKEY_PERFORMANCE_DATA;
extern final HANDLE HKEY_CURRENT_CONFIG;
extern final HANDLE HKEY_DYN_DATA;
Back to top
View user's profile Send private message
warker



Joined: 14 Dec 2007
Posts: 4

PostPosted: Sun Dec 16, 2007 2:36 pm    Post subject: Reply with quote

i tried you code .. (recompiled dwin.lib r85 from the stable 0.3 release as is)
the error is the same .. there is something going wrong in the HANDLE
it just work if i define it like i posted before ..

I also needed to add the Code to patch a Compile time Error with undiefined Symbol REG_QWORD not found


Code:
const int
  REG_UNKOWN = 0,       
  REG_STRING = 1,         
  REG_EXPANDSTRING = 2,   
  REG_BINARY = 3,         
  REG_DWORD = 4,         
  REG_MULTISTRING = 7,
  REG_QWORD = 11;         
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Sun Dec 16, 2007 10:23 pm    Post subject: Reply with quote

This is Tango thing.

I created a ticket about this :
http://www.dsource.org/projects/tango/ticket/820
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Wed Mar 05, 2008 7:00 pm    Post subject: Reply with quote

added to Registry.d:

Quote:
const HKEY
HKEY_CLASSES_ROOT = cast(HKEY) 0x80000000,
HKEY_CURRENT_USER = cast(HKEY) 0x80000001,
HKEY_LOCAL_MACHINE = cast(HKEY) 0x80000002,
HKEY_USERS = cast(HKEY) 0x80000003,
HKEY_PERFORMANCE_DATA = cast(HKEY) 0x80000004,
HKEY_CURRENT_CONFIG = cast(HKEY) 0x80000005,
HKEY_DYN_DATA = cast(HKEY) 0x80000006;

_________________
D yuyan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DWin All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group