当前位置 博文首页 > cumtchw:unable to open raise.c:Unable to read file /linux/r

    cumtchw:unable to open raise.c:Unable to read file /linux/r

    作者:[db:作者] 时间:2021-07-12 18:44

    目录

    错误一:unable to open raise.c:Unable to read file /linux/raise.c

    错误二:unable to open strlen.S:unable to read file vscode-remote?/glibc-2.27/sysdeps/aarch64/strlen.S

    错误三:cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): ? in function 'icvExtractPattern'


    错误一:unable to open raise.c:Unable to read file /linux/raise.c

    在用vscode远程调试ubuntu上面的代码时,遇到了如下的错误,

    unable to open raise.c:Unable to read file /linux/raise.c

    我还以为真的是因为缺少这个文件,但是实际上出现这个错误是因为程序有bug,我的launch.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": "(gdb) Launch",
                "type": "cppdbg",
                "request": "launch",
                "program": "/data/chw/firdge_3_location/action_detect_api/dt_demo",
                "args": [ ],
                "stopAtEntry": false,
                "cwd": "${fileDirname}",
                "environment": [],
                "externalConsole": false,
                "MIMode": "gdb",
                "setupCommands": [
                    {
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": false
                    }
                ]
            },
    
        ]
    }

    这时候实际上如果不用vscode调试,直接在命令行运行 ./de_demo会发现有段错误,这是因为少了参数,如果运行 ./dt_demo test.avi就不在报错,于是修改launch.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": "(gdb) Launch",
                "type": "cppdbg",
                "request": "launch",
                "program": "/data/chw/firdge_3_location/action_detect_api/dt_demo",
                "args": ["test.avi"],//增加参数
                "stopAtEntry": false,
                "cwd": "${fileDirname}",
                "environment": [],
                "externalConsole": false,
                "MIMode": "gdb",
                "setupCommands": [
                    {
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": false
                    }
                ]
            },
    
        ]
    }

    错误二:unable to open strlen.S:unable to read file vscode-remote?/glibc-2.27/sysdeps/aarch64/strlen.S

    ?同样的还有一次遇到了上面的错误,这个错误也不用通过去创建strlen.S去解决。出现这个错误也是因为我的可执行程序运行出错,修改完bug之后就好了。

    错误三:cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): ? in function 'icvExtractPattern'

    原来的代码是

    cv::VideoCapture cap;
    cap.open("./test.avi");

    修改为下面的代码就好了

    cv::VideoCapture cap;
    cap.open("./test001.avi");

    如果文件名不带数字,那么直接命令行运行是不报错的,但是调试的时候就报错。?

    有些时候vscode调试出错,可能不是软件配置的问题,而是你的程序有错误。

    cs
    下一篇:没有了