Make fail...config.h:467: error: 'usleep' was not declared in this scope

Hello,

Finally was able to successfully configure gnuradio on
Windows XP with MinGW/MSYS but fails during make. Does anyone have an
idea of what’s
going on here?

Thanks,
Dan


$ make
make all-recursive
make[1]: Entering directory /usr/src/gnuradio-3.1.3' Making all in config make[2]: Entering directory/usr/src/gnuradio-3.1.3/config’
make[2]: Nothing to be done for all'. make[2]: Leaving directory/usr/src/gnuradio-3.1.3/config’
Making all in omnithread
make[2]: Entering directory /usr/src/gnuradio-3.1.3/omnithread' /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DOMNITHREAD_NT=1 -DPthreadDraftVersion=10 -I/usr/src/gnuradio-3.1.3/omnithread -I/usr/local/include -g -O2 -Wall -Woverloaded-virtual -MT omni_time.lo -MD -MP -MF .deps/omni_time.Tpo -c -o omni_time.lo omni_time.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -DOMNITHREAD_NT=1 -DPthreadDraftVersion=10 -I/usr/src/gnuradio-3.1.3/omnithread -I/usr/local/include -g -O2 -Wall -Woverloaded-virtual -MT omni_time.lo -MD -MP -MF .deps/omni_time.Tpo -c omni_time.cc -DDLL_EXPORT -DPIC -o .libs/omni_time.o In file included from omni_time.cc:23: ../config.h: In functionint nanosleep(const timespec*, timespec*)’:
…/config.h:467: error: usleep' was not declared in this scope ../config.h:467: warning: unused variable 'usleep' make[2]: *** [omni_time.lo] Error 1 make[2]: Leaving directory/usr/src/gnuradio-3.1.3/omnithread’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/gnuradio-3.1.3’
make: *** [all] Error 2

“Dan J” wrote:

Finally was able to successfully configure gnuradio on
Windows XP with MinGW/MSYS but fails during make. Does anyone have an >
idea of what’s
going on here?
. . .
…/libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I…
…/config.h: In function int nanosleep(const timespec*, timespec*)': ../config.h:467: error:usleep’ was not declared in this scope
…/config.h:467: warning: unused variable ‘usleep’
make[2]: *** [omni_time.lo] Error 1
make[2]: Leaving directory /usr/src/gnuradio-3.1.3/omnithread' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/usr/src/gnuradio-3.1.3’
make: *** [all] Error 2

There appears to be some confusion about what sleep functions are
available
in your installation. If you do “fgrep -i sleep config.h” in your
top-level
directory, you should see that HAVE_SLEEP is defined but HAVE_USLEEP and
HAVE_NANOSLEEP are not. You should also see a declaration “int
usleep(…”,
which should prevent the error shown above.

It sounds like configure thinks that it has found usleep, but when you
go to
compile it isn’t found.

Did you install MinGW recently? Did you use the automated installer? Do
you
know what version of w32api you have?

– Don W.

Don,

Thanks for the input. The result of “fgrep -i sleep config.h” is:

fgrep -i sleep config.h
/* Define to 1 if you have the nanosleep' function. */ /* #undef HAVE_NANOSLEEP */ /* Define to 1 if you have thesleep’ function. /
/
#undef HAVE_SLEEP /
/
Define to 1 if you have win32 Sleep /
#define HAVE_SSLEEP 1
/
Define to 1 if you have the `usleep’ function. /
#define HAVE_USLEEP 1
#ifndef HAVE_USLEEP
int usleep(unsigned long usec); /
SUSv2 */
#ifndef HAVE_NANOSLEEP
static inline int nanosleep(const struct timespec req, struct timespec
rem) { return usleep(req->tv_sec1000000+req->tv_nsec/1000); }
#if defined(HAVE_SSLEEP) && !defined(HAVE_SLEEP)
/
TODO: what about SleepEx? /
static inline unsigned int sleep (unsigned int nb_sec) {
Sleep(nb_sec
1000); return 0; }

  1. I only installed MinGW yesterday and used MinGW-5.1.4.exe.
  2. Using w32api3.11

Thanks,
Dan

Don W. wrote:

“Dan J” wrote:

#define HAVE_USLEEP 1
This says that configure thinks you have a usleep() function somewhere.
This is different from my MinGW installation.

  1. I only installed MinGW yesterday and used MinGW-5.1.4.exe.
  2. Using w32api3.11

Your installation is much newer than mine, but I think I am using the
same
w32api.

You need to find out where configure is finding usleep. Looking at
config.log (search for “usleep”) may help. You can also go to
/mingw/include, /usr/include, /usr/local/include, etc. and try “fgrep
usleep
.h", “fgrep usleep /.h”, "fgrep usleep //.h”, etc. to look for it.
Then figure out why configure found it but your gnuradio compile didn’t.

– Don W.

Hey did you figured out the problem? since i installed gnuradio and i am
having exactly the same problem. I am unable to fix it so far. I can see
the usleep.cc function in
“C:\gnuradio-3.1.3\gnuradio-core\src\lib\missing” but i don’t know how
to make gnuradio find this.

“Dan J” wrote:

#define HAVE_USLEEP 1
This says that configure thinks you have a usleep() function somewhere.
This is different from my MinGW installation.

  1. I only installed MinGW yesterday and used MinGW-5.1.4.exe.
  2. Using w32api3.11

Your installation is much newer than mine, but I think I am using the
same
w32api.

You need to find out where configure is finding usleep. Looking at
config.log (search for “usleep”) may help. You can also go to
/mingw/include, /usr/include, /usr/local/include, etc. and try “fgrep
usleep
.h", “fgrep usleep /.h”, "fgrep usleep //.h”, etc. to look for it.
Then figure out why configure found it but your gnuradio compile didn’t.

– Don W.