编译c项目

时间:2015-06-07 16:46:12

标签: c windows visual-studio

我尝试使用visual studio developer命令提示符从此项目Emacs-FullScreen-Win32编译main.c但是我收到以下错误:

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 个答案:

答案 0 :(得分:0)

那些未解决的外部问题可能是由于您没有正确链接这些函数所来自的库。在项目设置中,转到项目属性。展开配置属性,然后展开链接器。在链接器的输入设置中,您可以在“其他依赖项”选项中指定程序所需的库。