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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
04c61e274156bd750f345d6ca28f56df?d=identicon&s=25 Dan J (Guest)
on 2009-01-02 01:57
(Received via mailing list)
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 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
Ad84973e0d95196c6e59bed61c3f349a?d=identicon&s=25 Don Ward (Guest)
on 2009-01-02 03:01
(Received via mailing list)
"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.
04c61e274156bd750f345d6ca28f56df?d=identicon&s=25 Dan J (Guest)
on 2009-01-02 04:32
(Received via mailing list)
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 the `sleep' 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_sec*1000000+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
Ad84973e0d95196c6e59bed61c3f349a?d=identicon&s=25 Don Ward (Guest)
on 2009-01-02 16:01
(Received via mailing list)
"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.
70db0f98cfed40a2c056afb49aaad581?d=identicon&s=25 Zainab Qureshi (zainab-qureshi)
on 2009-05-01 23:35
Don Ward 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.
This topic is locked and can not be replied to.