我用brew安裝了opencv3。我多次嘗試設置pkg-config,但是我無法成功編譯。我在互聯網上搜索的方式,但我無法找到。如何用Visual Studio代碼編譯Opencv?
的任務是如下:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "build",
"isBuildCommand": true,
"args": [
`pkg-config --libs opencv --cflags opencv`,
"-o",
"vsc",
"${workspaceRoot}/main.cpp",
"-g" // Debug
],
"showOutput": "always"
}
]
}
我pkg-config
是象下面這樣:
pkg配置--libs
$ pkg-config --libs opencv
-L/usr/local/Cellar/opencv3/3.1.0_3/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lippicv -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core
pkg配置--cflags
$ pkg-config --cflags opencv
-I/usr/local/Cellar/opencv3/3.1.0_3/include/opencv -I/usr/local/Cellar/opencv3/3.1.0_3/include
你知道如何用Visual Studio代碼編譯opencv嗎?
showOutput已棄用。它會要求你使用「演示文稿」,而「揭示」裏面應該設置爲「始終」。 – Antoni