Add opencv to eclipse on Windows

reference from http://stackoverflow.com/questions/13754348/opencv-on-eclipse-on-windows

step 1. download

1. eclipse c++. select Windows 32-bit or Windows 64-bit

2. mingGW.

  2.1 follow "Basic Setup", select all and click Installation -> apply...

  2.2 Add bin directory to path  (mycomputer -> prosperties -> advanced system settings -> Environment Variables -> system Variables:Path ->Edit add the directory).

3. OpenCV for Windows 2.4.10. Extract files and  add the bin directory => Path (mycomputer -> prosperties -> advanced system settings -> Environment Variables -> system Variables:Path ->Edit add the directory).

step 2. Create and Configure

1. Open the Eclipse, Create a new C++ project : File > New > C++ Project ( Don‘t forget to select the MinGW toolchains)

2. replace test code

///////////////CODE///////////

#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
  Mat im = imread(argc == 2 ? argv[1] : "lenna.png", 1);// the image in your project
  if (im.empty())
  {
    cout << "Cannot open image!" << endl;
    return -1;
  }
  imshow("image", im);
  waitKey(0);
  return 0;
}
///////////////CODE///////////

3. Now go to Properties >> C/C++ Build >> Settings on the Tool Setting tab :

    GCC C++ Compiler >> Includes and include opencv path ! [opencvDir\build\include]

    MinGW C++ Linker >> Libraries and add the Library search path [opencvDIR\build\x86\mingw\lib]

时间: 2024-08-04 18:50:31

Add opencv to eclipse on Windows的相关文章

Eclipse中和windows中的换行

不同系统的换行标识 windows 用   \r\n linux/unix 用   \n Mac   OS 用   \r 采用commons-io的包中的方法:FileUtils.writeStringToFile(file, "第一行是\\n\n第二行是\\r\r第三行是\\n\\r\n\r第四行是\\r\\n\r\n第五行");将这部分内容分别写入到windows中记事本和Eclipse项目目录下的文件中 这是我的测试数据:第一行是\\n\n第二行是\\r\r第三行是\\n\\r\

安装Eclipse(windows系统和linux系统)

1. 安装JDK 下载java SE 1.1 windows配置jdk windows配置jdk 1.2 Ubuntu配置jdk http://www.linuxidc.com/Linux/2015-01/111102.htm http://www.cnblogs.com/yxnchinahlj/p/3741583.html 2. 安装eclipse 下载eclipse的网址都是http://www.eclipse.org/downloads/eclipse-packages/ ,不过会自动识别

eclipse中windows下的preferences左栏没有tomcat?

是因为缺少eclipse for tomcat 插件,到http://www.eclipsetotale.com/tomcatPlugin.html此网站下载,我的eclipse版本是4.4版本的,所以我选择点击第一个(划红线部分)进行下载压缩包,可以根据eclipse版本自行选择下载,不知道版本的,可以查看eclipse安装文件夹中的readme文件.如图: 下载后,把压缩包放在eclipse安装目录中的dropins文件夹里,并解压到当前文件夹. 然后在eclipse安装目录中新建一个lin

hadoop-2.2.0配置eclipse插件(windows和linux平台)

目前配置eclipse插件主要有两个版本,一个是在windows下重新编译配置,另一个是在linux在重新配置编译. 下面逐步讲解在linux下编译-配置eclipse插件的过程. 环境: Ubuntu 12.04 64bit 3.2.0-29-generic eclipse-jee-luna-R-linux-gtk-x86_64.tar.gz Apache Ant(TM) version 1.8.2 JDK Version 1.7.0_67 安装前准备: Ant.jdk.eclipse.Apa

解决Ubuntu下的Eclipse打开Windows编写的java代码的中文乱码

其实所有的中文乱码 问题都是编码不同所导致的.这里要想让eclipse能正常显示出汉字,就要修改它的字符编码 步骤如下: 1 ,点击菜单栏中的Window(窗口),选择Preferences(首选项) 2,在出来的窗口中选择左边的General(常规).下拉出它的菜单 3,在选择Content Types选项,这是会在右边看到Text,点击拉下菜单 4,选择其中的Java Source File,然后把最下边下面的Default encoding设置成GBK(貌似GB18030和GB2312也行

OpenCV开发环境配置-Windows/MinGW/Clion/CMake

临时更换成了TDM-GCC,和mingw类似,这里只是声明一下. 由于opencv下载下来的.exe安装包实际上是没有mingw(gcc)匹配的/动静态库,因此这些东西需要我们自己使用mingw编译. 首先是cmake配置,直接在source目录命令行下执行 cmake . 即可(注意后边有空格和代表当前目录的点号) 一般来说应该可以了,然后就是使用mingw32-make命令完成编译(过程较长),最后是使用mingw32-make install 生成需要的文件(头文件/动/静态库) C:.

eclipse开发opencv官方教程

Introduction to Java Development Last updated: 12 February, 2013. As of OpenCV 2.4.4, OpenCV supports desktop Java development using nearly the same interface as for Android development. This guide will help you to create your first Java (or Scala) a

windows安装安卓开发环境Eclipse+SDK+ADT

准备条件 操作系统:win7 64位 需要的资源:JDK.Eclipse.SDK.ADT 步骤简介: 第一步:下载安装最新版JDK 第二步:下载安装Eclipse 第三步:下载安装SDK 第四步:安装ADT工具组件 下面详细说明一下安装的过程 第一步:JDK的下载和安装 建议到Oracle官方网站去下载最新版,注意选择适合自己系统的版本,地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 目前jdk最新版本是

Install OpenCV in Windows for Python

Here I will tell you how to install OpenCV 2.4x in Windows  for Python 2.7. Pre-requisites ( need to be downloaded ) : Python : Download latest version of Python 2.7 from Python site.Numpy : Download Numpy for Python 2.7 from here.OpenCV 2.4 : Downlo