尝试执行已编译的 C++ 时"Operation not permitted"
"Operation not permitted" when trying to execute compiled c++
我已经编译了这个websocket++打印服务器示例,执行了它,并通过在我的服务器和浏览器上进行测试来确认它的工作。
现在,我根据作者的建议,使用命令g++ -O3 -o bServer broadcast_server.cpp -I ~/websocketpp-experimental/ -std=c++0x -D_WEBSOCKETPP_CPP11_STL_ -D_WEBSOCKETPP_NO_CPP11_REGEX_ -lboost_regex -lboost_system
编译了这个 websocket++ 广播服务器示例。
./bServer
给Operation not permitted
.
ls -l bServer
给出了据我所知-rwxr-xr-x 1 root root 574151 Jun 29 22:31 bServer
表明它被允许执行。
如何执行此程序?
您的程序正在打印此消息。 查找打印位置并打印更多信息。
> Brian 抓住了问题的核心,以下是整体解决方案:
在broadcast_server.cpp示例中,有
try {
m_server.run();
} catch (const std::exception & e) {
std::cout << e.what() << std::endl;
} catch (websocketpp::lib::error_code e) {
std::cout << e.message() << std::endl;
} catch (...) {
std::cout << "other exception" << std::endl;
}
谷歌搜索std "Operation not permitted"
自动完成到std thread operation not permitted
,第一个结果是这个问题:C++0x:线程,gcc还是我的错误?
使用 -pthread
标志可以修复它。
相关文章:
- OpenMP卸载说'fatal error: could not find accel/nvptx-none/mkoffload'
- 使用JsonCpp将数据返回到带有pybind11的python会在python调用中产生Symbol not foun
- OpenCV Android C++ imwrite not found
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 使用单词"not"作为C ++类的名称会导致VS2019错误
- 错误"Could not find Boost"(缺少:上下文标头)
- 如何修复"error: ‘_1’ was not declared in this scope"?
- 套接字连接"Operation not permitted"错误,甚至使用升压/平发器根.cpp
- Is !NaN not a NaN?
- 为什么我会" void value not ignored as it ought to be"?
- 解决"ld: library not found for -ltensorflow_framework.2.3.0"
- C++命令行"Operation not allowed in WOW64"
- 尝试等待 boost::condition_Variable 时出现"unique_lock has no mutex: Operation not permitted"错误
- Linux gnu++11,在运行时获取"Enable multithreading to use std::thread: Operation not permitted"
- "Operation not permitted" 在 El Capitan 上运行 hello world 二进制编译 w/ clang++
- 尝试执行已编译的 C++ 时"Operation not permitted"
- 当所有 Windows 应用尝试使用 TCP 套接字时,我的应用导致错误 - 收到"operation on a socket could not be performed because..." (
- 尝试在 Visual Studio 2010 Pro SP1 中添加资源会导致"The operation could not be completed. Unspecified error"消息C+
- 抑制套接字"Operation not permitted"错误
- GDB -- 尝试定位本地主机时"Operation not permitted"