In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to install visual studio 2012 configuration, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
First, install vs2012
Download vs2012
1. Double-click the installation file to set the installation path
two。 Select the required installation package
3. Installation in progress
4. The installation is finally complete.
5. Click start
Prompt for product key
YKCW6-BPFPF-BT8C9-7DCTH-QXGWC
Activation succeeded
6. Other configuration pages appear
C++ is chosen as the default development environment here.
7. Start
8. Note that sometimes compatibility problems may occur and you need to download the update package
Just click install.
Second, install opencv
1. Download the opencv source code
Opencv official website address: http://opencv.org/, the network speed is a little slow
Click Download, and select the opencv version you want to download in the new page that pops up. Select 2.4.9 here.
Then, start downloading
Probably 349MB
two。 Decompress the source code
Any decompression path
Decompression password
3. Configure environment variables for opencv
(1) right-click "Properties" on the computer
(2) Advanced system settings
(3) Click the environment variable
(4) add the bin folder path of opencv to the environment variable named PATH, specifically:
① 32-bit system, add: d:\ File Program\ opencv\ build\ x86\ vc11\ bin
② 64-bit system, add:
D:\ File Program\ opencv\ build\ x86\ vc11\ bin (corresponding to 32-bit systems)
D:\ File Program\ opencv\ build\ x64\ vc11\ bin (corresponding to 64-bit systems)
The goal is to switch back and forth between compilers Win32 and X64
Note 1 opencv D:\ File Program\ opencv is the decompression path of opencv.
Note 2:vc11 indicates that the compilation environment is Microsoft Visual Studio 2012.
3. Configure opencv in vs2012
1. Open vs2012
two。 Create a new win32 console application
3. In solution Explorer: source File-> add-> New item
4. Configure at the property Manager
(a configuration in the property manager is equivalent to a general configuration process, and the new project does not have to be reconfigured in the future.)
(1) View-> property Manager
(2) property Manager pops up
(3) configure Debug Win32
Note: what is discussed here is that the configuration of Debug,Release is completely similar.
Right-click "Properties" in Microsoft.Cpp.Win32.user at Debug | Win32
Pop-up Microsoft.Cpp.Win32.user property page
(4) start configuring the Microsoft.Cpp.Win32.user property page
① adds an inclusion directory so that C++ programs can include opencv
Specifically: in the pop-up property page, find the "VC++ directory", and in the corresponding right include directory, enter the build- > include directory of opencv.
As you can see, there are two folders under the opencv- > build- > include directory. You should add this large directory and two folder directories to the include directory.
Add the following three directories to the include directory
D:\ File Program\ opencv\ build\ include
D:\ File Program\ opencv\ build\ include\ opencv
D:\ File Program\ opencv\ build\ include\ opencv2
② add Library Directory
Still to the right of the VC++ directory, add the opencv- > build- > x86-> vc11- > lib path to the library directory
That is: d:\ File Program\ opencv\ build\ x86\ vc11\ lib
Note: whether x64 or x86 is used here depends on the compiler (not the operating system! )
As shown in the following figure, the compiler is Win32, so you should select the library in the x86 directory
In addition:
Vc10 = Visual Studio 2010
Vc11 = Visual Studio 2012
Vc12 = Visual Studio 2013
③ adds a link library (i.e. dll)
Find the additional dependency on the right side of the linker-> input of the Microsoft.Cpp.Win32.user property page
Add the following dll name (version 2.4.9-dynamic link library in opencv corresponding to Debug)
Opencv_ml249d.lib
Opencv_calib3d249d.lib
Opencv_contrib249d.lib
Opencv_core249d.lib
Opencv_features2d249d.lib
Opencv_flann249d.lib
Opencv_gpu249d.lib
Opencv_highgui249d.lib
Opencv_imgproc249d.lib
Opencv_legacy249d.lib
Opencv_objdetect249d.lib
Opencv_ts249d.lib
Opencv_video249d.lib
Opencv_nonfree249d.lib
Opencv_ocl249d.lib
Opencv_photo249d.lib
Opencv_stitching249d.lib
Opencv_superres249d.lib
Opencv_videostab249d.lib
Note: if Release | Win32 is configured, the following 19 release versions without d need to be added
Opencv_objdetect249.lib
Opencv_ts249.lib
Opencv_video249.lib
Opencv_nonfree249.lib
Opencv_ocl249.lib
Opencv_photo249.lib
Opencv_stitching249.lib
Opencv_superres249.lib
Opencv_videostab249.lib
Opencv_calib3d249.lib
Opencv_contrib249.lib
Opencv_core249.lib
Opencv_features2d249.lib
Opencv_flann249.lib
Opencv_gpu249.lib
Opencv_highgui249.lib
Opencv_imgproc249.lib
Opencv_legacy249.lib
Opencv_ml249.lib
In addition, for opencv2.4.8
Debug version
Opencv_ml248d.lib
Opencv_calib3d248d.lib
Opencv_contrib248d.lib
Opencv_core248d.lib
Opencv_features2d248d.lib
Opencv_flann248d.lib
Opencv_gpu248d.lib
Opencv_highgui248d.lib
Opencv_imgproc248d.lib
Opencv_legacy248d.lib
Opencv_objdetect248d.lib
Opencv_ts248d.lib
Opencv_video248d.lib
Opencv_nonfree248d.lib
Opencv_ocl248d.lib
Opencv_photo248d.lib
Opencv_stitching248d.lib
Opencv_superres248d.lib
Opencv_videostab248d.lib
Release version
Opencv_objdetect248.lib
Opencv_ts248.lib
Opencv_video248.lib
Opencv_nonfree248.lib
Opencv_ocl248.lib
Opencv_photo248.lib
Opencv_stitching248.lib
Opencv_superres248.lib
Opencv_videostab248.lib
Opencv_calib3d248.lib
Opencv_contrib248.lib
Opencv_core248.lib
Opencv_features2d248.lib
Opencv_flann248.lib
Opencv_gpu248.lib
Opencv_highgui248.lib
Opencv_imgproc248.lib
Opencv_legacy248.lib
Opencv_ml248.lib
Test whether opencv is configured successfully
Create a new blank win32 console application
Add a cpp to the project and enter the following code in cpp
Note: be sure to make sure that the project path is under the pic image!
Or give the absolute path of the image directly (this can avoid path errors)
# include # include # include using namespace cv; int main () {/ / read a picture (original game painting) Mat img=imread ("pic.jpg"); / / create a window called "original game painting" window cvNamedWindow ("original game painting"); / / display the original game painting imshow ("original game painting", img) in the window; / / wait for 6000 ms and the window automatically closes waitKey (6000);}
(1) compilation
Success, no compilation errors
(2) run the program to display the image successfully
Note 1: if there is no image to be manipulated under the path, the following error occurs
Thank you for reading this article carefully. I hope the article "how to install and configure visual studio 2012" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.