Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gcc VSCODE的问题包括使用intels IPP libarays_Gcc_Visual Studio Code_G++_Vscode Tasks_Intel Ipp - Fatal编程技术网

Gcc VSCODE的问题包括使用intels IPP libarays

Gcc VSCODE的问题包括使用intels IPP libarays,gcc,visual-studio-code,g++,vscode-tasks,intel-ipp,Gcc,Visual Studio Code,G++,Vscode Tasks,Intel Ipp,嗨,我不明白为什么我不能使用visual studio代码从intels IPP libaray构建简单的示例它一直在说致命错误:IPP.h:没有这样的文件或目录 2 |#包括“ipp.h”。我不明白为什么VSCODE intellisense可以看到ipp包含的所有内容。 我使用Ubuntu 20.04 gcc/g++9和visual studio代码1.50.1。 如果我使用 g++-g ipptest.cpp-I$IPPROOT/include-L$IPPROOT/lib/intel64-

嗨,我不明白为什么我不能使用visual studio代码从intels IPP libaray构建简单的示例它一直在说致命错误:IPP.h:没有这样的文件或目录 2 |#包括“ipp.h”。我不明白为什么VSCODE intellisense可以看到ipp包含的所有内容。 我使用Ubuntu 20.04 gcc/g++9和visual studio代码1.50.1。 如果我使用

g++-g ipptest.cpp-I$IPPROOT/include-L$IPPROOT/lib/intel64-o ipptest-lippi-lipps-lippcore

然后跑

测试

从命令行 我的task.json文件如下所示

{
"version": "2.0.0",
"tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++ build active file",
        "command": "/usr/bin/g++",
        "args": [
            "-g",
            "${file}",
            "-I ${IPPROOT}/include",
            "-L ${IPPROOT}/lib/intel64",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}",
            "-lippi -lipps -lippcore"
        ],
        "options": {
            "cwd": "/usr/bin"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        },
        "detail": "compiler: /usr/bin/g++"
    }
]
}

和c_cpp_properties.json

{
"configurations": [
    {
        "name": "Linux",
        "includePath": [
            "${IPPROOT}/**",
            "${workspaceFolder}/**"
        ],
        "defines": [],
        "compilerPath": "/usr/bin/gcc",
        "cStandard": "gnu17",
        "cppStandard": "gnu++14",
        "intelliSenseMode": "gcc-x64"
    }
],
"version": 4

}

确定发现问题visual studio代码告诉您出了什么问题并不明智最终我发现了问题

问题出在task.json文件中

{
"version": "2.0.0",
"tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++ build active file",
        "command": "/usr/bin/g++",
        "args": [
            "-g",
            "${file}",
            "-I${IPPROOT}/include",
            "-L${LD_LIBRARY_PATH}",
            "-lippcore",
            "-lipps",
            "-lippi",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "options": {
            "cwd": "/usr/bin"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": "build",
        "detail": "compiler: /usr/bin/g++"
    }
]
task.json文件的固定版本

{
"version": "2.0.0",
"tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++ build active file",
        "command": "/usr/bin/g++",
        "args": [
            "-g",
            "${file}",
            "-I${IPPROOT}/include",
            "-L${LD_LIBRARY_PATH}",
            "-lippcore",
            "-lipps",
            "-lippi",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "options": {
            "cwd": "/usr/bin"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": "build",
        "detail": "compiler: /usr/bin/g++"
    }
]
}

问题-I${IPPROOT}/include错误 -I${IPPROOT}/include正确 在-I和-I之间不能有空格$ 此外,每个库文件必须添加到新行中,例如:不能这样写“-lipps-lippi-lippcore” 一定是这样写的 “-lipps”, “-里皮”, “-lippcore”

希望这能帮助遇到同样问题的人