Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unresolved external symbol WinMain referenced in function "int __cdecl __scrt_common_main_seh(void)" #19

Open
bartland opened this issue Aug 19, 2020 · 1 comment · May be fixed by #21

Comments

@bartland
Copy link

Hello

I'm having a look at this and am just trying the examples on Windows (I also work on MacOS and Linux but haven't tried them yet). Just letting you know of a link error.

DUB version 1.22.0, built on Aug 15 2020
DMD64 D Compiler v2.093.1-dirty

dub run :basic --force

Performing "debug" build using C:\D\dmd2\windows\bin64\dmd.exe for x86_64.
bindbc-loader 0.2.1: building configuration "noBC"...
C:\Users\bruce\AppData\Local\dub\packages\bindbc-loader-0.2.1\bindbc-loader\source\bindbc\loader\sharedlib.d(31,41): Deprecation: returning &this._error escapes a reference to parameter this, perhaps annotate with return
C:\Users\bruce\AppData\Local\dub\packages\bindbc-loader-0.2.1\bindbc-loader\source\bindbc\loader\sharedlib.d(37,43): Deprecation: returning &this._message escapes a reference to parameter this, perhaps annotate with return
bindbc-freetype 0.8.0: building configuration "dynamic"...
bindbc-opengl 0.12.0: building configuration "dynamic"...
inilike 1.1.0: building configuration "library"...
isfreedesktop 0.1.1: building configuration "library"...
xdgpaths 0.2.5: building configuration "library"...
icontheme 1.2.2: building configuration "library"...
mofile 0.2.1: building configuration "library"...
beamui 0.8.0+commit.342.ga52a3db: building configuration "library"...
beamui:platforms 0.8.0+commit.342.ga52a3db: building configuration "library-windows"...
beamui:basic 0.8.0+commit.342.ga52a3db: building configuration "application"...
Linking...
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
examples\basic\.dub\build\application-debug-windows-x86_64-dmd_2093-950929DD4103C0277C26CADE1DF53B2D\basic.exe : fatal error LNK1120: 1 unresolved externals
Error: linker exited with status 1120
C:\D\dmd2\windows\bin64\dmd.exe failed with exit code 1.

Here's the verbose output of the link command

Linking...
C:\D\dmd2\windows\bin64\dmd.exe -ofexamples\basic\.dub\build\application-debug-windows-x86_64-dmd_2093-950929DD4103C0277C26CADE1DF53B2D\basic.exe examples\basic\.dub\build\application-debug-windows-x86_64-dmd_2093-950929DD4103C0277C26CADE1DF53B2D\basic.obj platforms\.dub\build\library-windows-debug-windows-x86_64-dmd_2093-ABC47DB8F4170800B5263F23B503E052\beamui-platforms.lib .dub\build\library-debug-windows-x86_64-dmd_2093-E171B80A65629C04F5D186E06C11132E\beamui.lib C:\Users\bruce\AppData\Local\dub\packages\bindbc-freetype-0.8.0\bindbc-freetype\.dub\build\dynamic-debug-windows-x86_64-dmd_2093-29333F96929C7E159322F5E0EA983749\BindBC_FT.lib C:\Users\bruce\AppData\Local\dub\packages\bindbc-opengl-0.12.0\bindbc-opengl\.dub\build\dynamic-debug-windows-x86_64-dmd_2093-BC2B0004E007F3E58F0A21F6AC278982\BindBC_OpenGL.lib C:\Users\bruce\AppData\Local\dub\packages\bindbc-loader-0.2.1\bindbc-loader\.dub\build\noBC-debug-windows-x86_64-dmd_2093-B0589978128030D8C7359213823EACF6\BindBC_Loader.lib C:\Users\bruce\AppData\Local\dub\packages\icontheme-1.2.2\icontheme\.dub\build\library-debug-windows-x86_64-dmd_2093-AC356BD7A477EB4AEED06679854E7961\icontheme.lib C:\Users\bruce\AppData\Local\dub\packages\inilike-1.1.0\inilike\.dub\build\library-debug-windows-x86_64-dmd_2093-F8905D4C4F51DC345C8B49B9A3457C06\inilike.lib C:\Users\bruce\AppData\Local\dub\packages\xdgpaths-0.2.5\xdgpaths\.dub\build\library-debug-windows-x86_64-dmd_2093-3390FC08921AC8ABD132FCE80D663C62\xdgpaths.lib C:\Users\bruce\AppData\Local\dub\packages\mofile-0.2.1\mofile\.dub\build\library-debug-windows-x86_64-dmd_2093-1F210F074A6AF0580393391E7DCE2BBA\mofile.lib C:\Users\bruce\AppData\Local\dub\packages\isfreedesktop-0.1.1\isfreedesktop\.dub\build\library-debug-windows-x86_64-dmd_2093-8F135602C58C16010C64F7E6EEF6E2D5\isfreedesktop.lib -L/SUBSYSTEM:WINDOWS -LC:\tmp\beamui/libs/windows-x86_64/pixman-1.lib -L/SUBSYSTEM:WINDOWS -LC:\tmp\beamui/libs/windows-x86_64/pixman-1.lib -m64 -g
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
examples\basic\.dub\build\application-debug-windows-x86_64-dmd_2093-950929DD4103C0277C26CADE1DF53B2D\basic.exe : fatal error LNK1120: 1 unresolved externals
Error: linker exited with status 1120
FAIL examples\basic\.dub\build\application-debug-windows-x86_64-dmd_2093-950929DD4103C0277C26CADE1DF53B2D\ basic executable
C:\D\dmd2\windows\bin64\dmd.exe failed with exit code 1.
@dayllenger
Copy link
Owner

Sorry for the delay. It should work from now.

@my-ijet my-ijet linked a pull request Oct 23, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants