[Dlang-internal] A Proof of Concept for the baremetal D runtime plans

Mike Franklin slavo5150 at yahoo.com
Sat May 4 00:30:44 UTC 2019


On Friday, 3 May 2019 at 23:49:23 UTC, mbalantz wrote:

> Thanks again for getting back to me. Sorry, forgot to include 
> linker output. The errors are Error 42: symbol undefined and 
> "linker exited status 21"
>
> As follows:
>
> PS C:\Users\mbala\workspace\D\pongd_actual\source> dmd pongd.d 
> -odC:\Users\mbala\workspace\D\pongd\out\production\pongd\obj 
> -ofpongd -IC:\Users\mbala\Download
> s\SDL2-2.0.9\x86_64-w64-mingw32\include\SDL2 
> -LC:\Users\mbala\Downloads\SDL2-2.0.9-win32-x64\SDL2.dll
> pongd.d(399): Deprecation: switch case fallthrough - use 'goto 
> case;' if intended
> pongd.d(401): Deprecation: switch case fallthrough - use 'goto 
> case;' if intended
> pongd.d(403): Deprecation: switch case fallthrough - use 'goto 
> default;' if intended
> OPTLINK (R) for Win32  Release 8.00.17
> Copyright (C) Digital Mars 1989-2013  All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> OPTLINK : Warning 9: Unknown Option : NOIC
> :\Users\mbala\Downloads\SDL2-2.0.9-win32-x64\SDL2.dll
>  Warning 2: File Not Found 
> :\Users\mbala\Downloads\SDL2-2.0.9-win32-x64\SDL2.dll
> C:\Users\mbala\workspace\D\pongd\out\production\pongd\obj\pongd.obj(pongd)
>  Error 42: Symbol Undefined 
> __D6bindbc3sdl4bindQj8SDL_QuitPUNbNiZv
> C:\Users\mbala\workspace\D\pongd\out\production\pongd\obj\pongd.obj(pongd)
>  Error 42: Symbol Undefined 
> __D6bindbc3sdl4bind8sdlvideo17SDL_DestroyWindowPUNbNiPSQCaQBwQBvQBt10SDL_WindowZv
> C:\Users\mbala\workspace\D\pongd\out\production\pongd\obj\pongd.obj(pongd)
>  Error 42: Symbol Undefined 
> __D6bindbc3sdl4bind9sdlrender19SDL_DestroyRendererPUNbNiPSQCdQBzQByQBw12SDL_RendererZv
> C:\Users\mbala\workspace\D\pongd\out\production\pongd\obj\pongd.obj(pongd)
>  Error 42: Symbol Undefined
[..]

I donwloaded your code again, and the pongd.exe file contains a 
trojan:Win32/Fuery.!cl.  Not sure if that's a false positive, but 
it certainly wasn't encouraging.

What bothers me is why do you have a pongd.exe file if you're 
having trouble linking.  Seems very suspcious.  Where did that 
.exe come from if you're having trouble getting a build?

I see the message from optlink.  This is a linker (created by 
Walter, I think) that is used to link 32-bit code on Windows.  
Try compiling with -w64 instead.  -w64 will create a 64-bit 
binary and will use either LLVM's linker or Visual Studio's 
linker depending on which one it finds first.

Next, I see you are compiling pongd.d, but you're not compiling 
the code in the bindbc directory and I think that is the source 
of your linker errors.  You'll need to compile the bindbc 
directory to object code and link that in to you final executable.

Mike


More information about the Dlang-internal mailing list