How can I solve “Unable to open 'raise.c' ” Error?(VSCODE , LINUX)

蓝咒 提交于 2020-01-16 08:36:34

问题


( OS and Version: Ubuntu 18.4 , VS Code Version: Vscode 1.4 ,C/C++ Extension Version:0.26)

Hello, I have read all the articles about "raise.c" and none of them solved my problem, I just wrote a simple OpenCV code which captures webcam's frames. each time I run my code it frequently shows an error. the error message is:

Unable to open 'raise.c': Unable to read file (Error: File not found (/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c)).

launch.json is:

{
    // 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"
        }
    ]
}

and tasks.json is:

{
    "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"
}

So How can I solve this problem? is there any way to solve it. I am a beginner programmer.

and the second problem is each time I run this code my webcam freezes and I have to use "force quite "bottom. why my webcam freezes? any ideas are welcome. thanks. (I am using ubuntu and my IDE is Vscode )


回答1:


Finally, I found the solution after 3 days of working. I am going to write a solution for next generation. there is no need to search on internet you can't find anything :D okay if u wanna solve the problem u need to reinstall OpenCV again and turn all flags off. it's a bug. the flags which I used for are:

cmake -D BUILD_TIFF=ON -D WITH_CUDA=OFF -D ENABLE_AVX=OFF -D WITH_OPENGL=ON -D WITH_OPENCL=OFF -D WITH_IPP=OFF -D WITH_TBB=ON -D BUILD_TBB=ON -D WITH_EIGEN=OFF -D WITH_V4L=OFF -D WITH_VTK=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=./../opencv_contrib/modules ..

fill OPENCV_EXTRA_MODULES_PATH and CMAKE_INSTALL_PREFIX=/usr/local with the correct path! that's all, good luck.



来源:https://stackoverflow.com/questions/59126945/how-can-i-solve-unable-to-open-raise-c-errorvscode-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!