Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › windows下环境配置问题
Tagged: vscode
- This topic has 2 replies, 2 voices, and was last updated 1 year ago by
JiaFeiMiao.
-
AuthorPosts
-
-
v4vendeta
Participant用的是vcpkg+vscode
但是在编译的时候会报错找不到eigen和opencv -
v4vendeta
Participant此外在运行cmake. 的时候会出现如下错误
[main] Configuring folder: 代码框架
[proc] Executing command: “C:\Program Files\CMake\bin\cmake.EXE” –no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -Hd:/onedrive/Program/cg/GamesCG/homework/Assignment1/代码框架 -Bd:/onedrive/Program/cg/GamesCG/homework/Assignment1/代码框架/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error at CMakeLists.txt:4 (find_package):
[cmake] By not providing “FindOpenCV.cmake” in CMAKE_MODULE_PATH this project has
[cmake] asked CMake to find a package configuration file provided by “OpenCV”, but
[cmake] CMake did not find one.
[cmake]
[cmake] Could not find a package configuration file provided by “OpenCV” with any
[cmake] of the following names:
[cmake]
[cmake] OpenCVConfig.cmake
[cmake] opencv-config.cmake
[cmake]
[cmake] Add the installation prefix of “OpenCV” to CMAKE_PREFIX_PATH or set
[cmake] “OpenCV_DIR” to a directory containing one of the above files. If “OpenCV”
[cmake] provides a separate development package or SDK, be sure it has been
[cmake] installed.
[cmake]
[cmake]
[cmake] — Configuring incomplete, errors occurred!
[cmake] See also “D:/onedrive/Program/cg/GamesCG/homework/Assignment1/代码框架/build/CMakeFiles/CMakeOutput.log”. -
JiaFeiMiao
Participantsetting toolchain file in visual studio code and cmake tool for vsc doesn’t work
根据StackOverflow上这个问题的评论区修改CMakeLists.txt,实测有效
cmake_minimum_required(VERSION 3.20) set(CMAKE_TOOLCHAIN_FILE "C:/vcpkg/scripts/buildsystems/vcpkg.cmake") project(Rasterizer) find_package(OpenCV REQUIRED) set(CMAKE_CXX_STANDARD 17) include_directories(/usr/local/include) add_executable(Rasterizer main.cpp rasterizer.hpp rasterizer.cpp Triangle.hpp Triangle.cpp) target_link_libraries(Rasterizer ${OpenCV_LIBRARIES})
-
-
AuthorPosts
- You must be logged in to reply to this topic.