C- nmake等效于mingw命令



我在https://github.com/zserge/webview使用Windows build build build build build build of thak thak thak othig

mingw的命令行是

cc main.c -DWEBVIEW_WINAPI=1 -lole32 -lcomctl32 -loleaut32 -luuid -mwindows -o webview-example.exe

我正在使用/D WEBVIEW_WINAPI=1,并且已成功编译了.H文件。但是它在与unresolved externals的链接上失败。我不确定-lole32等要使用什么。

我尝试了/L,但会出现错误。知道什么是等效的?

编辑:

我添加了 /link ole32.lib comctl32.lib oleaut32.lib uuid.lib作为链接标志,但仍会在链接处出现错误:

C:UsersArunwebview>cl main.c /D WEBVIEW_WINAPI=1 /link ole32.lib comctl32.lib oleaut32.lib uuid.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.
main.c
c:usersarunwebviewwebview.h(1155): warning C4477: 'sscanf' : format string '%02x' requires an argument of type 'unsigned int *', but variadic argument 1 has type 'char *'
c:usersarunwebviewwebview.h(1155): note: consider using '%hhx' in the format string
Microsoft (R) Incremental Linker Version 14.16.27027.1
Copyright (C) Microsoft Corporation.  All rights reserved.
/out:main.exe
ole32.lib
comctl32.lib
oleaut32.lib
uuid.lib
main.obj
main.obj : error LNK2019: unresolved external symbol __imp_CreateSolidBrush referenced in function webview_set_color
main.obj : error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function webview_fix_ie_compat_mode
main.obj : error LNK2019: unresolved external symbol __imp_RegCreateKeyA referenced in function webview_fix_ie_compat_mode
main.obj : error LNK2019: unresolved external symbol __imp_RegSetValueExA referenced in function webview_fix_ie_compat_mode
main.exe : fatal error LNK1120: 4 unresolved externals

我使用以下命令来工作:

cl main.c /D WEBVIEW_WINAPI=1 /link ole32.lib comctl32.lib oleaut32.lib uuid.lib gdi32.lib advapi32.lib

缺少的功能位于gdi32.lib和advapi32.lib。

谢谢

最新更新