gpt4 book ai didi

c - 对 CreateProcessWithLogonW 的 undefined reference

转载 作者:太空宇宙 更新时间:2023-11-04 03:02:26 24 4
gpt4 key购买 nike

所以我一直在开发一个小应用程序,它在某些时候以另一个用户的身份运行一个应用程序,我用 C 编写它并使用 MinGW GCC 编译器来编译和链接它。我的问题是,每当我尝试使用 WINAPI 函数 CreateProcessWithLogonW() 时,我都会收到一条错误消息,提示“未定义对 CreateProcessWithLogonW() 的引用。”

尽管我这样编译时链接了 Advapi32,

gcc file.c -lAdvApi32 -o filename

最佳答案

正确的解决方案实际上是 #include 正确的 mingw32 header :即

#include <windows.h>

尽管 Anthales 提出的解决方案有效,但它的扩展性不佳。

关于c - 对 CreateProcessWithLogonW 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9889675/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com