问:我从哪里得到和如何使strsafe.h与微型C编译器工作,由贝拉。
以下是我的MinGW头文件之旅,但没有成功,
因为我无法使MinGW的strsafe.h .h头与微小的C编译器一起工作。
一开始。
我想运行/编译一些用C和
突然,strsafe.h头丢失在微小的C编译器 \include文件夹中。
jittey-main>tcc -run main.c
main.c:4: error: include file 'strsafe.h' not foundstrsafe.h头似乎没有包含在微型C编译器中。
因此,我尝试从strsafe.h下载明华项目(strsafe.h.h)头。
我把它放在/include文件夹中,突然又弹出了另一个丢失的头文件。
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:9: error: include file '_mingw_unicode.h' not found好的,我试着在mingw项目中找到_mingw_unicode.h。
我在这里找到了它:独角兽.h)
和以前一样,我把它放在/include文件夹中。
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:13: error: include file 'specstrings.h' not found再一次,我被另一个丢失的头文件所欢迎。
这里是:mingw项目(specstrings.h s.h)
和以前一样,我把它放在/include文件夹中。
tcc -run main.c
In file included from main.c:4:
In file included from other/strsafe.h:13:
other/specstrings.h:12: error: include file 'sal.h' not found现在这是重复的..。好了,在这里。
和以前一样,我把它放在/include文件夹中。
最后一个要解决的问题?要是那样就好了。
tcc -run main.c
In file included from main.c:4:
In file included from other/strsafe.h:13:
other/specstrings.h:336: error: include file 'driverspecs.h' not found和以前一样,我把它放在/include文件夹中。
错误的微小变化。H头包含C++语法?我被困在这里了。
从这个错误中,我猜来自MinGW项目的MinGW头与C89、C99或C11语言不兼容。
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:131: error: ',' expected (got "dwFlags")准确的错误行可以在这里找到:strsafe.h:131: error
我现在不知道该怎么办了。
发布于 2021-07-29 06:29:37
这是不完整的答案。
不回答如何使用windows-10-sdk.设置TCC。
strsafe.h定位
我做了一些研究,我发现strsafe.h是windows-10-sdk的一部分
windows-10-sdk的设置文件名为winsdksetup.exe。
设置的大小出乎意料地小。(1,29 MB)
但是,安装程序在安装后会下载并生成额外的(1,86 GB)。
默认情况下,windows-10-sdk将安装到此目录中:
C:\Program Files (x86)\Windows Kits\10
安装windows-10-sdk后
strsafe.h.h的位置在这里:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\strsafe.h
在这里可以找到strsafe.lib文件:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86\strsafe.lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64\strsafe.lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm64\strsafe.lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm\strsafe.lib10.0.19041.0是windows-10-sdk的版本号.
x86 x64 arm64 arm是指令集体系结构。
在这里可以找到一些额外的必需的.h头
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\
使用Windows编译的进一步失败
我有一些尝试来编译前面提到的文本编辑器项目。
我试着链接Windows的.h头
tcc main.c "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared"但最终还是以失败告终。
我收到以下错误:
jittey-main>tcc main.c "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" "-LC:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86"
In file included from main.c:4:
In file included from c:/users/juozas/desktop/latest-built/include/winapi/windows.h:66:
In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared/windef.h:1:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared/winapifamily.h:226: warning: WINAPI_FAMILY_PARTITION redefined
In file included from main.c:4:
In file included from c:/users/juozas/desktop/latest-built/include/winapi/windows.h:67:
c:/users/juozas/desktop/latest-built/include/winapi/winbase.h:150: error: ';' expected (got "WINBOOL")我怀疑这个错误可能显示了已经存在于小型C编译器中的windows.h与Windows的头文件不兼容。
我认为微型C编译器需要修改Windows的标题,这可以很好地合并。
回到MinGW
安装Windows并链接.lib文件之后。
由于相同的标头问题仍然出现并持续存在。
我认为用MinGW建立TCC是值得一试的。
还有一个建议是用MinGW头重新编译小型C编译器。
但我不确定它会不会起什么作用。
但我可能会在不那么繁忙的一天尝试。
https://stackoverflow.com/questions/68555992
复制相似问题