抱歉哈 我也忘記了。只能提供一些我的文件中的一些信息給你參考了。
********in CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(Rasterizer)
find_package(OpenCV REQUIRED)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_C_COMPILER “H:\\compiler\\mingw64\\bin\\gcc.exe”)
set(CMAKE_CXX_COMPILER “H:\\compiler\\mingw64\\bin\\g++.exe”)
include_directories(“H:\\programing\\cpp_file\\ustcCG\\Eigen”)
add_executable(Rasterizer main.cpp rasterizer.hpp rasterizer.cpp global.hpp Triangle.hpp Triangle.cpp Texture.hpp Texture.cpp Shader.hpp OBJ_Loader.h)
target_link_libraries(Rasterizer ${OpenCV_LIBRARIES})
#target_compile_options(Rasterizer PUBLIC -Wall -Wextra -pedantic)
*********in Texture.hpp
#ifndef RASTERIZER_TEXTURE_H
#define RASTERIZER_TEXTURE_H
#include “global.hpp”
#include <Eigen/Eigen>
#include <opencv2/opencv.hpp>
*********in main.cpp
#include <iostream>
#include <opencv2/opencv.hpp>
#include “global.hpp”
#include “rasterizer.hpp”
#include “Triangle.hpp”
#include “Shader.hpp”
#include “Texture.hpp”
#include “OBJ_Loader.h”