OpenCV various versions of the Universal header file

Source: Internet
Author: User

Each time you download a new version of OPENCV, you need to re-write the header file, change the link library configuration, it is troublesome to have wood? Below this header file is I in someone else's code to Amoy out, very good, share with you ~ (the specific author forgot, sorry AH)

The author has cleverly used OPENCV version information to define a macro, whether your OPENCV is 243 or 246 can be perfect support, no longer worry about the updated version of the problem, another: for the older version of OPENCV may have the name of the individual Lib is not correct, modify it can be

StdAfx.h

 #pragma once#include "targetver.h" #include <stdio.h> #include <tchar.h> #include <iostream># Include <fstream> #include <opencv2/opencv.hpp> #define CV_VERSION_ID cvaux_str (cv_major_version) cvaux_s TR (cv_minor_version) cvaux_str (cv_subminor_version) #ifdef _debug#define cvlib (name) "OPENCV_" name cv_version_id "D" # Else#define cvlib (name) "OPENCV_" name Cv_version_id#endif#pragma comment (lib, cvlib ("core")) #pragma comment (lib, Cvli B ("Imgproc")) #pragma comment (lib, cvlib ("Highgui")) #pragma comment (lib, cvlib ("Flann")) #pragma comment (lib, cvlib ("F Eatures2d ")) #pragma comment (lib, cvlib (" calib3d ")) #pragma comment (lib, cvlib (" GPU ")) #pragma comment (lib, cvlib (" Lega Cy ")) #pragma comment (lib, cvlib (" ml ")) #pragma comment (lib, cvlib (" Objdetect ")) #pragma comment (lib, cvlib (" ts ")) #pra GMA Comment (Lib, cvlib ("video")) #pragma comment (lib, cvlib ("contrib")) #pragma comment (lib, cvlib ("nonfree")) 
Source Address: http://www.cnblogs.com/easymind223/p/3308279.html

OpenCV various versions of the Universal header file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.