用mingw编译时缺少assert.h
我正在用 MinGW 编译 C 代码。 C 代码是 tcl 包/扩展。
(使用MinGW编译器,下载:mingw-get-inst-20111118.exe)
编译代码(例如tcl包)在linux下工作正常。 我正在运行“./configure”并使用提供的“Makefile.in”。
问题是 C 代码在某些时候包含“assert.h”。
其他头文件都很好,例如“string.h”和“stdlib.h”。 这是因为 TCL 源文件包含一个名为“./compat”的子文件夹。头文件位于此文件夹中,以防在其他地方找不到它们。
但在“./compat”文件夹中,文件“assert.h”丢失。所以我得到一个错误。
我在“c:\MinGW\include”中搜索了头文件,但没有找到“assert.h”。
要么我将自己的“assert.h”复制到“./compat”文件夹中。或者我安装一些 MinGW 软件包,将一些“assert.h”放入“c:\MinGW\”的子文件夹中。
=== 解决方案:====
c:\MinGW\include\assert.h
我前面就是空洞时间!!! 我的坏!谢谢。
I am compiling C code with MinGW. The C code is a tcl package/extension.
(using the MinGW compilor, downloaded: mingw-get-inst-20111118.exe)
Compiling the code (e.g. the tcl package) works fine under linux.
I am running "./configure" and using the supplied "Makefile.in".
The problem is that the C code at some point includes "assert.h".
The other header files are fine, e.g. for "string.h" and "stdlib.h".
This is because the TCL sources include a subfolder called "./compat". In this filder the header files are located just in case they are not found somewhere else.
But in the "./compat" folder the file "assert.h" is missing. So I get an error.
I searched for the header file in "c:\MinGW\include" but I did not find "assert.h" there.
Either I copy my own "assert.h" in the "./compat" folder. Or I install some MinGW package that puts some "assert.h" in a subfolder of "c:\MinGW\".
=== SOLUTION: ====
c:\MinGW\include\assert.h
I was the hole time in front of me!!!
My bad! thx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是标准 C 的一部分,包含在基本开发包中:您下载了开发包吗?
你下载了这个吗?
http://sourceforge.net/projects/mingw/files/MinGW/Base /mingw-rt/mingwrt-3.20/
我不知道tcl包的特殊性,但是它是否包含自己的assert.h。那么您应该在包含路径中包含 on 及其附带的库。
您使用的是哪个 IDE?
看来你只下载了部分 mingw。下载与 Codelite 和 Code::Blocks 等 IDE 捆绑在一起的完整开发包。
<assert.h>
is part of standard C and included with the base dev package:Did you download the dev package?
Did you download this?
http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.20/
I don't know about the peculiarities of the tcl package, but if it includes its own assert.h. then you should include on on the Include path, along with the libraries that came with it.
Which IDE are your using?
It seems you downloaded only mingw partially. Download the full development package that is bundled with IDEs like Codelite and Code::Blocks.