您好,我不明白为什么我不能使用visual studio代码从intels IPP libaray构建简单的示例,它一直显示致命错误: ipp.h:没有这样的文件或目录2| #include "ipp.h“。我不明白为什么VSCODE intellisense可以很好地看到所有的ipp。我使用的是Ubuntu 20.04,gcc/g++ 9和visual studio代码1.50.1。我可以很好地编译和运行示例,如果我使用
include -g ipptest.cpp -I $IPPROOT/include -L$IPPROOT/lib/intel64 -o ipptest -lippi -lipps -lippcore
然后运行
./ipptest
在命令行中,我的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
}
发布于 2020-11-05 21:37:05
好了,发现问题的visual studio代码不是很聪明,告诉你什么是错的,最终我发现了问题。
问题出在task.json文件中
修复了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和$之间有空格每个库文件都必须添加到新行上例如:不能这样写"-lipps -lippi -lippcore“必须写成这样"-lipps","-lippi","-lippcore”
希望这篇文章能帮助那些遇到同样问题的人
https://stackoverflow.com/questions/64697640
复制相似问题