当前位置:网站首页>Clion installation + MinGW configuration + opencv installation
Clion installation + MinGW configuration + opencv installation
2022-06-26 08:45:00 【will be that man】
CLion install +MinGW To configure +Opencv install
clion Official website Register with student email jetbrains account number , It can be used for one year free jetbrains Software for , After one year, you can continue to extend it on the official website .
installed clion After that, configure the compilation environment ,win10 Common environments are MinGW. visit MingW-W64 Official website , And click... At the top of the page Downloads link . stay Downloads Page hits MingW-W64-builds link . Click... On the next page SourceForge link . Then you can download mingw-w64-install.exe This installation file , And then install . choice x86_64-posix-seh This version .
function CLion, stay Settings → Build, Execution, Deployment Find toolchains. And then click + Number , add to MinGW The compiler of .
New projects . choice C++ executable, Select a project's location, then creat. Wait a while after the new one , When the progress bar in the lower right corner is completed , You can write your code , The green arrow in the upper right corner executes . choice MinGW The installation directory , Such as “D:\MinGW”. After selection CLion It will automatically scan the compiler tools in the directory , If you can't scan it, you can add it manually . Click on OK, Complete the configuration .
To configure opencv. There are two ways , The first is first Cmake, And then use Cmake compile opencv. The second method is to directly download the compiled opencv, Here is a github link , Download and unzip to your favorite path , And then “opencv route \x64\mingw\bin” Environment variables added to the system , then “opencv route \x64\mingw\lib” All of them ".lib.a" Put the compressed file into “C:\Windows\SysWOW64” Under the table of contents (64 position ), 32 Is it “C:\Windows\System32”.
Write programs using opencv At the time of cmakelist Add the following :
cmake_minimum_required(VERSION 3.14) project(demo) set(OpenCV_DIR D:\\OpenCV-MinGW-Build-OpenCV-4.1.1-x64) find_package(OpenCV REQUIRED) set(CMAKE_CXX_STANDARD 11) add_executable(demo testOpencv.cpp) include_directories(${ OpenCV_INCLUDE_DIRS}) target_link_libraries(demo ${ OpenCV_LIBS})Test with the following code :
"""testOpencv.cpp""" #include <iostream> #include <opencv2/highgui/highgui.hpp> using namespace std; using namespace cv; int main() { Mat img = imread("C:\\Users\\19728\\Desktop\\timg.jpg"); if (img.empty()) { cout << "Error" << endl; return -1; } namedWindow("pic", WINDOW_FULLSCREEN); imshow("pic", img); waitKey(); return 0; }The results are as follows :

边栏推荐
- Object extraction_ nanyangjx
- Tokenizer description in Bert
- Learning signal integrity from scratch (SIPI) -- 3 challenges faced by Si and Si based design methods
- RecyclerView Item 根据 x,y 坐标得到当前position(位置)
- [unity mirror] use of networkteam
- Swift code implements method calls
- WBC learning notes (II): practical application of WBC control
- HEVC学习之码流分析
- Application of wireless charging receiving chip xs016 coffee mixing cup
- Record the problem yaml file contains Chinese message 'GBK' error
猜你喜欢

Interpretation of x-vlm multimodal model

Learning signal integrity from scratch (SIPI) -- 3 challenges faced by Si and Si based design methods

WBC learning notes (II): practical application of WBC control

Trimming_ nanyangjx

Detailed process of generating URDF file from SW model

Fabrication of modulation and demodulation circuit

WBC learning notes (I): manually push WBC formula

关于极客时间 | MySQL实战45讲的部分总结

Recovering the system with Clonezilla USB disk

FFmpeg音视频播放器实现
随机推荐
And are two numbers of S
Time functions supported in optee
Stanford doggo source code study
Koa_ mySQL_ Integration of TS
2020-10-17
Design of reverse five times voltage amplifier circuit
73b2d wireless charging and receiving chip scheme
Principle of playing card image segmentation
The difference between push-pull circuit drive and totem pole drive
51 single chip microcomputer project design: schematic diagram of timed pet feeding system (LCD 1602, timed alarm clock, key timing) Protues, KEIL, DXP
[已解决]setOnNavigationItemSelectedListener()被弃用
Performance comparison of unaryexpr's function on matrix elements in eigen Library
Degree of freedom analysis_ nanyangjx
[unity mirror] use of networkteam
STM32 based d18s20 (one wire)
Detailed explanation of SOC multi-core startup process
Tokenizer description in Bert
Diode voltage doubling circuit
Monitor iPad Keyboard Display and hide events
STM32 project design: smart door lock PCB and source code based on stm32f1 (4 unlocking methods)