View mode: basic / threaded / horizontal-split · Log in · Help
December 30, 2006
Error 42: Symbol Undefined...
I'm new to D and DWT (but not SWT) and I'm trying to do this simple thing:

import dwt.all;

void main ()
{
	Display display = Display.getDefault();
}

and I get this output:

C:\>dmd -d main.d
link main,,,user32+kernel32/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

main.obj(main)
Error 42: Symbol Undefined _D3dwt7widgets7display7Display10getDefaultFZC3dwt7wi
dgets7display7Display
--- errorlevel 1

What I'm I doing wrong?
(excuse for any bad English)
December 30, 2006
Re: Error 42: Symbol Undefined...
doob wrote:
> I'm new to D and DWT (but not SWT) and I'm trying to do this simple thing:
> 
> import dwt.all;
> 
> void main ()
> {
> 	Display display = Display.getDefault();
> }
> 
> and I get this output:
> 
> C:\>dmd -d main.d
> link main,,,user32+kernel32/noi;
> OPTLINK (R) for Win32  Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> 
> main.obj(main)
>  Error 42: Symbol Undefined _D3dwt7widgets7display7Display10getDefaultFZC3dwt7wi
> dgets7display7Display
> --- errorlevel 1
> 
> What I'm I doing wrong?
> (excuse for any bad English)
> 
> 
> 

You need to link to dwt.lib, something like dmd -d main.d dwt.lib
December 30, 2006
Re: Error 42: Symbol Undefined...
== Quote from bobef (be@lessequal_dontspam.com)'s article
> doob wrote:
> > I'm new to D and DWT (but not SWT) and I'm trying to do this simple thing:
> >
> > import dwt.all;
> >
> > void main ()
> > {
> > 	Display display = Display.getDefault();
> > }
> >
> > and I get this output:
> >
> > C:\>dmd -d main.d
> > link main,,,user32+kernel32/noi;
> > OPTLINK (R) for Win32  Release 7.50B1
> > Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> >
> > main.obj(main)
> >  Error 42: Symbol Undefined _D3dwt7widgets7display7Display10getDefaultFZC3dwt7wi
> > dgets7display7Display
> > --- errorlevel 1
> >
> > What I'm I doing wrong?
> > (excuse for any bad English)
> >
> >
> >
> You need to link to dwt.lib, something like dmd -d main.d dwt.lib

I tried dmd -d main.d dwt.lib, but I got this output:

C:\>dmd -d main.d dwt.lib
C:\dmd\bin\..\..\dm\bin\link.exe main,,,dwt.lib+user32+kernel32/no
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

C:\dmd\bin\..\lib\dwt.lib(display)
Error 42: Symbol Undefined _RegOpenKeyExW@20
C:\dmd\bin\..\lib\dwt.lib(display)
Error 42: Symbol Undefined _RegQueryValueExW@24
C:\dmd\bin\..\lib\dwt.lib(display)
Error 42: Symbol Undefined _RegCloseKey@4
C:\dmd\bin\..\lib\dwt.lib(display)
Error 42: Symbol Undefined _CreateFontIndirectW@4
C:\dmd\bin\..\lib\dwt.lib(display)
Error 42: Symbol Undefined _GetStockObject@4
C:\dmd\bin\..\lib\dwt.lib(display)
Error 42: Symbol Undefined _DeleteObject@4
C:\dmd\bin\..\lib\dwt.lib(device)
Error 42: Symbol Undefined _CreatePalette@4
C:\dmd\bin\..\lib\dwt.lib(device)
Error 42: Symbol Undefined _GetSystemPaletteEntries@16
C:\dmd\bin\..\lib\dwt.lib(device)
Error 42: Symbol Undefined _GetDeviceCaps@8
C:\dmd\bin\..\lib\dwt.lib(device)
Error 42: Symbol Undefined _ScriptGetProperties@8
C:\dmd\bin\..\lib\dwt.lib(device)
Error 42: Symbol Undefined _EnumFontFamiliesW@16
C:\dmd\bin\..\lib\dwt.lib(device)
Error 42: Symbol Undefined _SelectObject@8
C:\dmd\bin\..\lib\dwt.lib(device)
Error 42: Symbol Undefined _GetTextMetricsW@8
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_GetImageCount@4
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_SetIconSize@12
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_GetIconSize@12
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_AddMasked@12
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_Add@12
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_Replace@16
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_ReplaceIcon@12
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _GetObjectW@12
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _CreateCompatibleDC@4
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _CreateCompatibleBitmap@12
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _SetStretchBltMode@8
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _StretchBlt@44
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _BitBlt@36
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _DeleteDC@4
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _CreateBitmap@20
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _SetBkColor@8
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _PatBlt@24
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_Destroy@4
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_Remove@8
C:\dmd\bin\..\lib\dwt.lib(imagelist)
Error 42: Symbol Undefined _ImageList_Create@20
C:\dmd\bin\..\lib\dwt.lib(os)
Error 42: Symbol Undefined _OleInitialize@4
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmCreateContext@0
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmAssociateContext@8
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _CreateSolidBrush@4
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmGetContext@4
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmGetOpenStatus@4
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmGetConversionStatus@12
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmReleaseContext@8
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmDestroyContext@4
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _SelectPalette@12
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _RealizePalette@4
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmSetOpenStatus@8
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _ImmSetConversionStatus@12
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _CreateRectRgn@16
C:\dmd\bin\..\lib\dwt.lib(shell)
Error 42: Symbol Undefined _CombineRgn@16
C:\dmd\bin\..\lib\dwt.lib(image)
Error 42: Symbol Undefined _GetPaletteEntries@16
C:\dmd\bin\..\lib\dwt.lib(image)
Error 42: Symbol Undefined _CreateDIBSection@24
C:\dmd\bin\..\lib\dwt.lib(image)
Error 42: Symbol Undefined _GetDIBColorTable@16
C:\dmd\bin\..\lib\dwt.lib(image)
Error 42: Symbol Undefined _GetDIBits@28
C:\dmd\bin\..\lib\dwt.lib(image)
Error 42: Symbol Undefined _SetDIBColorTable@16
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetClipRgn@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetRgnBox@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _Arc@36
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetPixel@12
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _OffsetRgn@12
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _SelectClipRgn@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _SetROP2@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _MoveToEx@16
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _LineTo@12
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetTextColor@4
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _SetPixel@16
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _Ellipse@20
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _Polygon@12
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _Polyline@12
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _Rectangle@20
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _RoundRect@28
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetROP2@4
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _SetBkMode@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _ExtTextOutW@32
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetTextExtentPoint32W@16
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _SetTextColor@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetCurrentObject@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetBkColor@4
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _Pie@36
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GradientFill@24
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetCharWidthW@16
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetCharABCWidthsW@16
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetClipBox@8
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _SetRectRgn@20
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetLayout@4
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _GetRandomRgn@12
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _CreatePen@12
C:\dmd\bin\..\lib\dwt.lib(gc)
Error 42: Symbol Undefined _SetLayout@8
C:\dmd\bin\..\lib\dwt.lib(color)
Error 42: Symbol Undefined _GetNearestPaletteIndex@8
C:\dmd\bin\..\lib\dwt.lib(color)
Error 42: Symbol Undefined _SetPaletteEntries@16
C:\dmd\bin\..\lib\dwt.lib(fontdata)
Error 42: Symbol Undefined _TranslateCharsetInfo@12
C:\dmd\bin\..\lib\dwt.lib(widget)
Error 42: Symbol Undefined _InitCommonControls@0
C:\dmd\bin\..\lib\dwt.lib(composite)
Error 42: Symbol Undefined _RestoreDC@8
C:\dmd\bin\..\lib\dwt.lib(composite)
Error 42: Symbol Undefined _SaveDC@4
C:\dmd\bin\..\lib\dwt.lib(composite)
Error 42: Symbol Undefined _GetRegionData@12
C:\dmd\bin\..\lib\dwt.lib(accessible)
Error 42: Symbol Undefined _LresultFromObject@12
C:\dmd\bin\..\lib\dwt.lib(accessible)
Error 42: Symbol Undefined _IsEqualGUID@8
C:\dmd\bin\..\lib\dwt.lib(converter)
Error 42: Symbol Undefined _SysStringByteLen@4
C:\dmd\bin\..\lib\dwt.lib(converter)
Error 42: Symbol Undefined _SysFreeString@4
C:\dmd\bin\..\lib\dwt.lib(accessible)
Error 42: Symbol Undefined _SysAllocString@4
C:\dmd\bin\..\lib\dwt.lib(accessible)
Error 42: Symbol Undefined _CreateStdAccessibleObject@16
C:\dmd\bin\..\lib\phobos.lib(com)
Error 42: Symbol Undefined _IID_IUnknown
--- errorlevel 100

I suppose there is still some link problem
December 31, 2006
Re: Error 42: Symbol Undefined...
Oh man. OK. Here is my command line to build rulesPlayer. Modify it for 
your needs.

dmd ..\core.d app.d common.d console.d playlist.d config.d player.def 
player.d ..\thirdparty\lib\process.d ..\thirdparty\lib\pipestream.d 
-ofplayer.exe -I..\thirdparty -I..\..\ -version=OLE_COM -version=DRAG_DROP

-I are import paths
-the versions are needed if you going to use DND inside DWT
-of is the output file
the rest are source files
and I have these inside my source (you can supply them on the command 
line if you prefer)

pragma(lib,"advapi32.lib");
pragma(lib,"comctl32.lib");
pragma(lib,"gdi32.lib");
pragma(lib,"shell32.lib");
pragma(lib,"comdlg32.lib");
pragma(lib,"ole32.lib");
pragma(lib,"uuid.lib");
pragma(lib,"..\\thirdparty\\dwt\\dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\dwtextra.lib");
pragma(lib,"..\\thirdparty\\dwt\\user32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\imm32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\shell32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\msimg32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\gdi32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\kernel32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\usp10_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\olepro32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\oleaut32_dwt.lib");
pragma(lib,"..\\thirdparty\\dwt\\oleacc_dwt.lib");


By the way you can try the build utility (bud on dsource or something 
leka that). It simplifies the build process, i.e. you don't have to 
manually supply all the source files and libraries (I am not sure about 
the libraries though).
January 02, 2007
Re: Error 42: Symbol Undefined...
Thanks bobef. I solved it by adding the libs using pragma and using the build tool
with the command: build main.d -gui
Top | Discussion index | About this forum | D home