4
votes

I tried to compile main.c from this project Emacs-FullScreen-Win32 by using visual studio developer command prompt but I get the following error:

main.c
Microsoft (R) Incremental Linker Version 11.00.60610.1

Copyright (C) Microsoft Corporation.  All rights reserved.

/out:main.exe

main.obj

main.obj : error LNK2019: unresolved external symbol __imp__ShowWindowAsync@8 re
ferenced in function _WinMain@16

main.obj : error LNK2019: unresolved external symbol __imp__SetWindowPos@28 refe
renced in function _WinMain@16

main.obj : error LNK2019: unresolved external symbol __imp__MessageBoxW@16 refer
enced in function _WinMain@16

main.obj : error LNK2019: unresolved external symbol __imp__GetWindowLongW@8 ref
erenced in function _WinMain@16

main.obj : error LNK2019: unresolved external symbol __imp__SetWindowLongW@12 re
ferenced in function _WinMain@16

main.obj : error LNK2019: unresolved external symbol __imp__FindWindowW@8 refere
nced in function _WinMain@16

main.obj : error LNK2019: unresolved external symbol __imp__CommandLineToArgvW@8
 referenced in function _is_topmost_requested

main.exe : fatal error LNK1120: 7 unresolved externals
1
I added all the output to the question. - user1123975
You apparently neglected to include the requisite libraries in your link line to pull those imports referenced by your program. You need User32.lib and Shell32.lib at a minimum to link that image. If this is from a make or automake provided with the project, you may be missing a build switch required to build for your target platform. Best of luck. - WhozCraig

1 Answers

1
votes

Those unresolved external problems are likely due to you not properly linking the libraries that those functions are from. In your project settings, go to project properties. Expand configuration properties, then expand linker. In the linker's input settings, you can specify libraries that the program requires in the "additional dependencies" option.