You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ncvalidator.c: In function ‘main’:
ncvalidator.c:2288:5: warning: implicit declaration of function ‘getopt’ [-Wimplicit-function-declaration]
while ((i = getopt(argc, argv, "xthq")) != EOF)
^
ncvalidator.c:2301:14: error: ‘optind’ undeclared (first use in this function)
if (argv[optind] == NULL) { /* input file name is mandatory */
^
ncvalidator.c:2301:14: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [Makefile:1322: ncvalidator.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/workspace/srcdir/netcdf-c-4.8.1/ncdump'
make[2]: *** [Makefile:1401: all-recursive] Error 1
make[2]: Leaving directory '/workspace/srcdir/netcdf-c-4.8.1/ncdump'
make[1]: *** [Makefile:729: all-recursive] Error 1
make[1]: Leaving directory '/workspace/srcdir/netcdf-c-4.8.1'
make: *** [Makefile:574: all] Error 2
Previous command exited with 2
The follow patch solves this issue:
From 86baf9cd28c20ad3589546639b44b776edef1684 Mon Sep 17 00:00:00 2001
From: Alexander Barth <barth.alexander@gmail.com>
Date: Wed, 2 Mar 2022 14:24:23 +0100
Subject: [PATCH 2/3] include getopt.h if available
---
ncdump/ncvalidator.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ncdump/ncvalidator.c b/ncdump/ncvalidator.c
index dead0d03..8f275b10 100644
--- a/ncdump/ncvalidator.c+++ b/ncdump/ncvalidator.c@@ -60,6 +60,9 @@ THIS SOFTWARE.
*/
#include "config.h"
+#ifdef HAVE_GETOPT_H+#include <getopt.h>+#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h> /* open() */
--
2.25.1
In essence we include getopt.h if HAVE_GETOPT_H is defined as in ncdump/ncdump.c
The text was updated successfully, but these errors were encountered:
## Include <getopt.h> in various utilities
re: Unidata#2303
As noted, some utilities are using getopt() without including
getopt.h, so add as needed.
## Turn off run_diskless2.sh when ENABLE_PARALLEL is true
re: Unidata#2315
Ed notes that this test hangs when running parallel. The test
is attempting to create a very large in-memory file, which is
the proximate cause. But no idea what's the underlying cause.
I am trying to cross-compile NetCDF 4.8.1 for the julia project but I have a compile error on aarch64-linux-gnu.
NetCDF 4.8.1
Cross-compilation: host: Linux x86_64 target: aarch64-linux-gnu
Compiler: aarch64-linux-gnu-gcc (GCC) 4.8.5
NetCDF is compiled and configured in the following way:
The full error message is:
The follow patch solves this issue:
In essence we include getopt.h if HAVE_GETOPT_H is defined as in ncdump/ncdump.c
The text was updated successfully, but these errors were encountered: