编译中带有 vadefs.h 的 CL 错误 C1189
首先我想减小可执行文件的大小, 我用的是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论