You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2019/07/30 20:31:00 UTC

[jira] [Commented] (AVRO-2489) Build error C3861: 'sleep': identifier not found

    [ https://issues.apache.org/jira/browse/AVRO-2489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16896498#comment-16896498 ] 

Daniel Kulp commented on AVRO-2489:
-----------------------------------

Changing from sleep to Sleep is definitely not the right solution.   

It should be one of:

a) Add {code:c++}#include <unistd.h>{code} to import the sleep definition 
or
b) Likely more "C++":

{code:c++}
#include <thread>
#include <chrono>

std::this_thread::sleep_for(std::chrono::seconds(1));
{code}

Any chance you could double check one (or both) of those?


> Build error C3861:  'sleep': identifier not found
> -------------------------------------------------
>
>                 Key: AVRO-2489
>                 URL: https://issues.apache.org/jira/browse/AVRO-2489
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.9.0
>         Environment: Windows Server 2016,
> VS2019,
> cmake 3.15,
> vcpkg 2019.06.26
> Jenkins 2.186
>            Reporter: Andrew Ripa
>            Priority: Minor
>              Labels: build
>
> Steps to reproduce:
>  * Fetched 1.9.0 repo [https://github.com/apache/avro/releases/tag/release-1.9.0] from git and  cd to 'lang/c++' folder
>  * Project generated with 
> {code:java}
> mkdir _build
> cd _build
> cmake -G "Visual Studio 16 2019" -A x64 .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="PATH_TO_vcpkg.cmake" -DCMAKE_INSTALL_PREFIX="PATH_TO_INSTALL"{code}
>  * Built with
> {code:java}
> cmake --build . --config Release
> {code}
>  * Installed with
> {code:java}
> cmake --build . --config Release --target Install
> {code}
> During the last (install) step received an error
> {noformat}
> PATH_TO_WORKSPACE\workspace\avro\avro\lang\c++\test\DataFileTests.cc(592,13): error C3861:  'sleep': identifier not found [PATH_TO_WORKSPACE\workspace\avro\avro\lang\c++\_build\DataFileTests.vcxproj]{noformat}
>  
> Possible hotfix found [https://social.msdn.microsoft.com/Forums/vstudio/en-US/fdc9d1c3-1082-4c0d-a717-a39313562d4f/sleep?forum=vclanguage]
> Need to change 'sleep(1)' to '{color:#ff0000}*S*{color}leep(1)' in lang/c++/testDataFileTests.cc
>  After that build (and install) completed without errors



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)