繁体   English   中英

错误:使用ReaderLock = std :: shared_lock的&#39;shared_mutex&#39;不是&#39;std&#39;的成员 <std::shared_mutex> ;

[英]error: ‘shared_mutex’ is not a member of ‘std’ using ReaderLock = std::shared_lock<std::shared_mutex>;

我正在尝试使用Microsoft SEAL库进行同态加密,并在使用cmake命令时遵循以下链接https://github.com/cyberweapons/SEAL/blob/master/INSTALL.txt的步骤进行操作。 终端显示以下结果

-- SEAL detected (version 2.3.1)
-- SEAL build type: Release
-- SEAL debug mode: OFF
-- SEAL using Microsoft GSL: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ravindra/Desktop/../../MiSEAL/SEAL/SEALExamples

之后,当我给出make命令时,它应该生成一个文件main.cpp.o,而是出现以下错误。

 [ 50%] Building CXX object CMakeFiles/sealexamples.dir/main.cpp.o
In file included from /usr/local/include/seal/util/mempool.h:12:0,
                 from /usr/local/include/seal/memorypoolhandle.h:6,
                 from /usr/local/include/seal/biguint.h:6,
                 from /usr/local/include/seal/bigpoly.h:9,
                 from /usr/local/include/seal/seal.h:3,
                 from /home/ravindra/Desktop/SakhaProjects/S20_AI/MiSEAL/SEAL/SEALExamples/main.cpp:12:
/usr/local/include/seal/util/locks.h:12:45: error: ‘shared_mutex’ is not a member of ‘std’
         using ReaderLock = std::shared_lock<std::shared_mutex>;
                                             ^~~
/usr/local/include/seal/util/locks.h:12:45: error: ‘shared_mutex’ is not a member of ‘std’
/usr/local/include/seal/util/locks.h:12:62: error: template argument 1 is invalid
         using ReaderLock = std::shared_lock<std::shared_mutex>;
                                                              ^
/usr/local/include/seal/util/locks.h:14:45: error: ‘shared_mutex’ is not a member of ‘std’
         using WriterLock = std::unique_lock<std::shared_mutex>;
                                             ^~~
/usr/local/include/seal/util/locks.h:14:45: error: ‘shared_mutex’ is not a member of ‘std’
/usr/local/include/seal/util/locks.h:14:62: error: template argument 1 is invalid
         using WriterLock = std::unique_lock<std::shared_mutex>;
                                                              ^
/usr/local/include/seal/util/locks.h:21:20: error: ‘ReaderLock’ does not name a type
             inline ReaderLock acquire_read()
                    ^~~~~~~~~~
/usr/local/include/seal/util/locks.h:26:20: error: ‘WriterLock’ does not name a type
             inline WriterLock acquire_write()
                    ^~~~~~~~~~
/usr/local/include/seal/util/locks.h:31:20: error: ‘ReaderLock’ does not name a type
             inline ReaderLock try_acquire_read()
                    ^~~~~~~~~~
/usr/local/include/seal/util/locks.h:36:20: error: ‘WriterLock’ does not name a type
             inline WriterLock try_acquire_write()
                    ^~~~~~~~~~
/usr/local/include/seal/util/locks.h:46:18: error: ‘shared_mutex’ in namespace ‘std’ does not name a type
             std::shared_mutex rw_lock_mutex_;
                  ^~~~~~~~~~~~
In file included from /usr/local/include/seal/memorypoolhandle.h:6:0,
                 from /usr/local/include/seal/biguint.h:6,
                 from /usr/local/include/seal/bigpoly.h:9,
                 from /usr/local/include/seal/seal.h:3,
                 from /home/ravindra/Desktop/SakhaProjects/S20_AI/MiSEAL/SEAL/SEALExamples/main.cpp:12:
/usr/local/include/seal/util/mempool.h: In member function ‘virtual int64_t seal::util::MemoryPoolMT::pool_count() const’:
/usr/local/include/seal/util/mempool.h:561:17: error: ‘ReaderLock’ was not declared in this scope
                 ReaderLock lock(pools_locker_.acquire_read());
                 ^~~~~~~~~~
CMakeFiles/sealexamples.dir/build.make:62: recipe for target 'CMakeFiles/sealexamples.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/sealexamples.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/sealexamples.dir/all' failed
make[1]: *** [CMakeFiles/sealexamples.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

我是SEAL库的新手,也是C ++编程的初学者,请有人帮助我解决此问题。

嗨,我找到了解决方案,我在CMakeLists.txt文件中包含以下命令,并继续执行步骤`

# Below is TFHE START
export TFHE_PREFIX=/usr/local
export CPLUS_INCLUDE_PATH=${TFHE_PREFIX}/include:${CPLUS_INCLUDE_PATH}
export C_INCLUDE_PATH=${TFHE_PREFIX}/include:${C_INCLUDE_PATH}
export LIBRARY_PATH=${TFHE_PREFIX}/lib:${LIBRARY_PATH}
export LD_LIBRARY_PATH=${TFHE_PREFIX}/lib:${LD_LIBRARY_PATH}
# Below is TFHE END

`

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM