4

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
Mofi
  • 46,139
  • 17
  • 80
  • 143
user1123975
  • 165
  • 4
  • 14
  • I added all the output to the question. – user1123975 Jun 07 '15 at 17:01
  • 1
    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 Jun 07 '15 at 17:31
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Raymond Chen Jun 08 '15 at 06:10

1 Answers1

1

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.

red_always_mafia
  • 179
  • 2
  • 10