编译中带有 vadefs.h 的 CL 错误 C1189

发布于 2025-01-10 06:03:57 字数 1447 浏览 0 评论 0原文

首先我想减小可执行文件的大小, 我用的是 gcc 编译器。 我希望在 Windows 编译器中使用 cl.exe 进行编译,它具有更有趣的属性,

如果不使用标志,我想

cl /I "C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include" main.c

在一个非常小的测试代码中

#include <stdio.h>

int main(){
    printf("hello world");
    return 1;
}

使用此命令,该代码只包含默认库和打印。 结果:

Optimization compiler Microsoft (R) C/C++ version 19.29.30140 for ARM64
Copyright (C) Microsoft Corporation. all rights reserved.

main.c
C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include\vadefs.h(92): fatal error C1189: #error:  VARARGS not implemented for this TARGET

vadefs.h文件的内容:

#if defined (__GNUC__)
/* Use GCC builtins */

(...)
#elif defined(_MSC_VER)
/* MSVC specific */

#if defined(_M_IA64)
(...)
#endif

#if defined(_M_IX86)

(...)
#elif defined(_M_AMD64)

(...)
#elif defined(_M_IA64)

#error VARARGS not implemented for IA64

#else

#error VARARGS not implemented for this TARGET

我也尝试定义每个常量 _M_AMD64 和 _M_IX86 定义编译器打印很多错误,

C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include\stdio.h(599): error C2059: syntax error: 'type'
(...)
C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include\swprintf.inl(34): error C2059: syntax error: 'type'

我怎样才能编译这个简单的代码 main.c 而不出现错误? 谢谢

first of all I want to reduce the size of my executable,
I was using the gcc compiler.
I'm looking to compile with the cl.exe in windows compiler, it has properties that are more interesting

Without using the flags I would like to use this command

cl /I "C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include" main.c

in a very tiny test code

#include <stdio.h>

int main(){
    printf("hello world");
    return 1;
}

who just include the default library and print.
The result:

Optimization compiler Microsoft (R) C/C++ version 19.29.30140 for ARM64
Copyright (C) Microsoft Corporation. all rights reserved.

main.c
C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include\vadefs.h(92): fatal error C1189: #error:  VARARGS not implemented for this TARGET

content of the vadefs.h file:

#if defined (__GNUC__)
/* Use GCC builtins */

(...)
#elif defined(_MSC_VER)
/* MSVC specific */

#if defined(_M_IA64)
(...)
#endif

#if defined(_M_IX86)

(...)
#elif defined(_M_AMD64)

(...)
#elif defined(_M_IA64)

#error VARARGS not implemented for IA64

#else

#error VARARGS not implemented for this TARGET

i also tried to define each constants
_M_AMD64 and _M_IX86 defined the compiler print lot of errors

C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include\stdio.h(599): error C2059: syntax error: 'type'
(...)
C:\Users\Prince 2 lu\Desktop\mingw64\x86_64-w64-mingw32\include\swprintf.inl(34): error C2059: syntax error: 'type'

how can i compile this simple code main.c without theres errors ?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文