C nmake相当于mingw命令

C nmake相当于mingw命令,c,webkit,mingw,linker-errors,cl,C,Webkit,Mingw,Linker Errors,Cl,我尝试使用Windows构建工具编译库 mingw的命令行是 cc main.c -DWEBVIEW_WINAPI=1 -lole32 -lcomctl32 -loleaut32 -luuid -mwindows -o webview-example.exe 我正在使用/D WEBVIEW\u WINAPI=1,并且.h文件已成功编译。但它在与未解析外部链接时失败。我不知道用什么来做-lole32等等 我尝试了/L,但它给出了错误。知道等价物是什么吗 编辑: 我添加了/link ole32.l

我尝试使用Windows构建工具编译库

mingw
的命令行是

cc main.c -DWEBVIEW_WINAPI=1 -lole32 -lcomctl32 -loleaut32 -luuid -mwindows -o webview-example.exe
我正在使用
/D WEBVIEW\u WINAPI=1
,并且.h文件已成功编译。但它在与
未解析外部链接时失败。我不知道用什么来做
-lole32
等等

我尝试了
/L
,但它给出了错误。知道等价物是什么吗

编辑:

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

C:\Users\Arun\webview>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:\users\arun\webview\webview.h(1155): warning C4477: 'sscanf' : format string '%02x' requires an argument of type 'unsigned int *', but variadic argument 1 has type 'char *'
c:\users\arun\webview\webview.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


谢谢

我使用以下命令使其工作:

cl main.c /D WEBVIEW_WINAPI=1 /link ole32.lib comctl32.lib oleaut32.lib uuid.lib gdi32.lib advapi32.lib
缺少的函数位于gdi32.lib和advapi32.lib

谢谢