Include missing <stdlib.h> for calloc(3) and exit(3)
Hello! When trying to build current HEAD of dillo in NetBSD the build fails with: [...] g++ ... -o dialog.o dialog.cc [...] dialog.cc:38:1: note: 'calloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' 37 | #include "dlib/dlib.h" +++ |+#include <cstdlib> 38 | dialog.cc:192:11: error: 'exit' was not declared in this scope 192 | exit(1); | ^~~~ dialog.cc:192:11: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' *** [dialog.o] Error code 1 [...] Including <stdlib.h> fixes that and the attached patch does that. Thank you!
Hi, On Mon, Jan 12, 2026 at 11:04:07AM +0100, Leonardo Taccari wrote:
Hello!
When trying to build current HEAD of dillo in NetBSD the build fails with:
[...] g++ ... -o dialog.o dialog.cc [...] dialog.cc:38:1: note: 'calloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' 37 | #include "dlib/dlib.h" +++ |+#include <cstdlib> 38 | dialog.cc:192:11: error: 'exit' was not declared in this scope 192 | exit(1); | ^~~~ dialog.cc:192:11: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' *** [dialog.o] Error code 1 [...]
Including <stdlib.h> fixes that and the attached patch does that.
Thanks!, merged in: https://git.dillo-browser.org/dillo/commit/?id=7c6ccebe61077902160798e5af46e... Best, Rodrigo
Hello Rodrigo, Rodrigo Arias writes:
Hi,
On Mon, Jan 12, 2026 at 11:04:07AM +0100, Leonardo Taccari wrote:
Hello!
When trying to build current HEAD of dillo in NetBSD the build fails with:
[...] g++ ... -o dialog.o dialog.cc [...] dialog.cc:38:1: note: 'calloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' 37 | #include "dlib/dlib.h" +++ |+#include <cstdlib> 38 | dialog.cc:192:11: error: 'exit' was not declared in this scope 192 | exit(1); | ^~~~ dialog.cc:192:11: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' *** [dialog.o] Error code 1 [...]
Including <stdlib.h> fixes that and the attached patch does that.
Thanks!, merged in:
https://git.dillo-browser.org/dillo/commit/?id=7c6ccebe61077902160798e5af46e... [...]
Thank you very much for quickly applying it!
participants (2)
-
Leonardo Taccari -
Rodrigo Arias