nmake相当于mingw命令

问题描述 投票:1回答:1

我正在尝试使用Windows Build工具在https://github.com/zserge/webview编译库。

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:\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
c webkit mingw linker-errors cl
1个回答
0
投票

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

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

缺少的函数驻留在gdi32.lib和advapi32.lib中。

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.