简体   繁体   中英

assert.h missing when compiling with mingw

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 (eg 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, eg 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.

<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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM