Thread overview
MessageBoxA linking error
6 days ago
bauss
6 days ago
bauss
6 days ago

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
6 days ago

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

6 days ago

On Wednesday, 11 December 2024 at 11:32:44 UTC, Ferhat Kurtulmuş wrote:

>

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

pragma(lib, "user32") worked. Thank you.