Re: compile error building newest release on Cygwin

Kai Vehmanen <[email protected]> Sat, 4 Jan 2020 18:01:48 +0200 (EET)
Newsgroups gmane.comp.audio.ecasound.general
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1463811582-339848339-1578153708=:1833
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

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
---1463811582-339848339-1578153708=:1833
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


---1463811582-339848339-1578153708=:1833
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ecasound-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ecasound-list

---1463811582-339848339-1578153708=:1833--