MessageBoxA linking error

Ferhat Kurtulmuş aferust at gmail.com
Wed Dec 11 11:32:44 UTC 2024


On Wednesday, 11 December 2024 at 11:22:09 UTC, bauss wrote:
> Whenever I try to use MessageBoxA then I get a linking error 
> that the symbol cannot be found.
>
> I am importing core.sys.windows.windows.
>
> What else am I missing?
>
> The exact error:
>
> ```
> lld-link: error: undefined symbol: MessageBoxA
>>>> referenced by ...\source\client\source\main.d:24
>>>>               
>>>> ...\~master\build\application-debug-FMqG_QyKCCZMqpWApQaoww\....obj:(WinMain)
> Error: linker exited with status 1
> ```

I have no idea whether it should be automatically linked with it, 
but it requires User32.lib

pragma(lib, "user32"); should work, otherwise it must be provided 
via linker flags.

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messageboxa


More information about the Digitalmars-d-learn mailing list