error: ‘HZ’ undeclared (first use in this function) - arm

I am trying to setup Dhrystone where I am getting the following error.
error: ‘HZ’ undeclared (first use in this function)
I don't the significance of HZ variable. I can compile the code straightaway by commenting the code which includes HZ variable. But is it the right way to do. Please help me in this regard.

Related

Compiling PostgreSQL extension, getting "error: ‘work_mem’ undeclared (first use in this function)"

When I compile the extension I've got, I'm getting
error: ‘work_mem’ undeclared (first use in this function)
17 | Tuplestorestate *tupstore = tuplestore_begin_heap(true, false, work_mem);
What header includes work_mem?
The work_mem symbol is provided by misadmin.h you will have to add that header into your .c file.
#include "miscadmin.h"

glib : glib 2.5 installation issue

I am working on Red Hat 6 with kernal version 2.6.32 , I am trying build glib 2.5 on my machine. And fail with following error:-
Log:-
../../gio/gfile.c: In function ‘splice_stream_with_progress’:
../../gio/gfile.c:3019: error: ‘F_SETPIPE_SZ’ undeclared (first use in this function)
../../gio/gfile.c:3019: error: (Each undeclared identifier is reported only once
../../gio/gfile.c:3019: error: for each function it appears in.)
../../gio/gfile.c:3023: error: ‘F_GETPIPE_SZ’ undeclared (first use in this function)
make[4]: *** [libgio_2_0_la-gfile.lo] Error 1
I can find the solution of at F_SETPIPE_SZ undeclared , placing #define _GNU_SOURCE before all includes in file gfile.c, But it didn't work. As mentioned in second answer: Older kernels (e.g. 2.6.32 as used in RHEL6) don't have them and we need bypass it in whatever you're building. How could we do that?
Appreciate your help .
Thanks in Advance.
The bug is fixed in this commit.
architectures without F_SETPIPE_SZ and F_GETPIPE_SZ such as or1k.
If those variables are undefined, put back previous behavior, buffer
size set to 1024 * 64
https://gitlab.gnome.org/GNOME/glib/-/commit/0beb62f564072f3585762c9c55fe894485993b62
You can apply the patch to your code.

My http-parser.c callbacks are undeclared

I am working on a server. I have included the http-parser.h header file and used their code for how to use it. However, when I compile I get the following errors:
'my_url_callback' undeclared
'my_header_field_callback' undeclared
'my_socket' undeclared
I assumed that these were defined in the header file. Apparently, I was mistaken. How should I declare these?

error: `TFD_NONBLOCK' undeclared (first use in this function)

I am using timerfd mechanism, and getting this error on compilation: error:TFD_NONBLOCK' undeclared (first use in this function)`
How to resolve?
Here is the statement:
timer_fd = timerfd_create(CLOCK_REALTIME, TFD_NONBLOCK);
Looks like timerfd support is missing from libc. sys/timerfd.h is absent. Any workarounds for this?
To use timerfd_create(), you need to run Linux 2.6.25 (or higher) with glibc 2.8 (or higher).

How to disable "'variable' undeclared (first use in this function)" warning in RHIDE (DJGPP)

I have an old C program (which I didn't write) which worked for me before on a machine I had using DJGPP with RHIDE under DOS.
The problem is, that since I've moved to a new machine, when I try and compile it, I get loads (100s) of "'variable' undeclared (first use in this function)" warnings.
I don't have the time to go back over this and amend the code at the minute... is there a way to disable this warning and let me build?
Thanks for any help.
EDIT:
Sorry guys, this isn't my area at all. The following code:
char *sbname;
sbname = calloc (99, sizeof(char));
The second line produces an error of:
Error: 'sbname' undeclared (first use in this function)
This hadn't produced any errors on the last machine, so I assumed there is a setup issue.
Thanks

Resources