Re: [ecasound] compile error building newest release on Cygwin

From: Kai Vehmanen <kvlists@email-addr-hidden>
Date: Sat Jan 04 2020 - 18:01:48 EET

Hi David,

sorry for late reply.

On Mon, 18 Nov 2019, David O'Toole wrote:
> Hi, I'm having trouble getting Ecasound 2.9.2 release to compile on Cygwin. Below is a transcript of configuration and make, which fails with 'usleep not
> declared in this scope'. Thanks in advance for any help or advice you can offer, let me know if I can help with more information.

This might be not useful to you anymore, but in case you still have the
Cygwin environment ready, maybe you can give this a try.

kvutils: fix compilation errors for nanosleep/usleep
https://github.com/kaivehmanen/ecasound/commit/4a802eb2b5f96d7aa521d83baa2698fec5ccc7e0

This is a bit odd problem as configure found usleep:

> checking for usleep... yes

... but when compiling, it fails:

> libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I.. -ffast-math -fstrict-aliasing -std=c++98 -DNDEBUG -DENABLE_DBC -g -O2 -MT kvu_utils.lo -MD -MP -MF
> .deps/kvu_utils.Tpo -c kvu_utils.cpp  -DDLL_EXPORT -DPIC -o .libs/kvu_utils.o
> kvu_utils.cpp: In function 'int kvu_sleep(long int, long int)':
> kvu_utils.cpp:680:9: error: 'usleep' was not declared in this scope
>    ret = usleep(seconds * 1000000 + nanoseconds / 1000);
>          ^~~~~~

What I suspect happens it that -std=c++98 caused the compiler to take
the namespaces more striclly and as the file has a "using namepsace std"
at start, it fails to find usleep. The above commit attempts at a fix
based on this hypothesis.

Br, Kai

_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Sat Jan 4 20:15:01 2020

This archive was generated by hypermail 2.1.8 : Sat Jan 04 2020 - 20:15:01 EET