Skip to content

history.c:240:53: error: ‘errno’ undeclared #4944

@mc-worker

Description

@mc-worker

Discussed in #4942

Originally posted by for-coursera January 5, 2026
Hi!

I'm trying to build mc as an AppImage (mostly for testing purposes) using AppImageCrafters/build-appimage-action@master workflow, and got this error while compiling:

CC       history.lo
history.c: In function ‘history_save’:
history.c:240:53: error: ‘errno’ undeclared (first use in this function)
  240 |     if (chmod (profile, S_IRUSR | S_IWUSR) != -1 || errno == ENOENT)
      |                                                     ^~~~~
history.c:49:1: note: ‘errno’ is defined in header ‘<errno.h>’; did you forget to ‘#include <errno.h>’?
   48 | #include "lib/mcconfig.h"  // num_history_items_recorded
  +++ |+#include <errno.h>
   49 | 
history.c:240:53: note: each undeclared identifier is reported only once for each function it appears in
  240 |     if (chmod (profile, S_IRUSR | S_IWUSR) != -1 || errno == ENOENT)
      |                                                     ^~~~~
history.c:240:62: error: ‘ENOENT’ undeclared (first use in this function)
  240 |     if (chmod (profile, S_IRUSR | S_IWUSR) != -1 || errno == ENOENT)
      |                                                              ^~~~~~
history.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-assign-enum’ [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [Makefile:549: history.lo] Error 1

Somehitng I should install additionally maybe?

I add these packages before building:

apt-get install -y autoconf autopoint check gettext libtool pkg-config e2fslibs-dev libaspell-dev libglib2.0-dev libgpm-dev libncurses5-dev libslang2-dev libssh2-1-dev libx11-dev unzip

And then do

./autogen.sh && ./configure --with-screen=ncurses --enable-werror

Would be grateful for a hint.

Metadata

Metadata

Assignees

Labels

area: buildBuild system and (cross-)compilationprio: mediumHas the potential to affect progress

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions