(操作系统和版本:Ubuntu 18.4,VS Code 版本:Vscode 1.4,C/C++ 扩展版本:0.26)
您好,我已经阅读了所有关于“raise.c”的文章,但都没有解决我的问题,我只是编写了一个简单的 OpenCV 代码来捕获网络摄像头的帧。每次我运行我的代码时,它经常显示一个错误。错误信息是:
无法打开“raise.c”:无法读取文件(错误:找不到文件(/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c))。
启动.json 是:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
和 tasks.json 是:
{
"tasks": [
{
"type": "shell",
"label": "g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"`pkg-config",
"--libs",
"--cflags",
"opencv4`"
],
"options": {
"cwd": "/usr/bin"
}
}
],
"version": "2.0.0"
}
那么我该如何解决这个问题呢?有什么办法可以解决。我是初学者程序员。
第二个问题是每次我运行此代码时,我的网络摄像头都会冻结,我必须使用“强制相当”底部。为什么我的网络摄像头死机了?欢迎任何想法。谢谢。 (我使用的是 ubuntu,我的 IDE 是 Vscode )
原文由 Hamid Reza 发布,翻译遵循 CC BY-SA 4.0 许可协议
终于,经过3天的工作,我找到了解决方案。我正在为下一代编写解决方案。没有必要在互联网上搜索你找不到任何东西:D
好的,如果您想解决问题,您需要再次重新安装 OpenCV 并关闭所有标志。这是一个错误。我使用的标志是:
用正确的路径填充
OPENCV_EXTRA_MODULES_PATH
和CMAKE_INSTALL_PREFIX=/usr/local
!仅此而已,祝你好运。