Thread: OpenCV and Visual Studio 2010: Infamous namespace error.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    596
    I don't have a Windows machine handy to test with, but where did you ever read any mention of a "namespace cv"? And where did you find "cv.hpp"?

    Try
    Code:
    #include <cv.h>
    #include <cxcore.h>
    #include <highgui.h>
    #include <iostream>
    using namespace std; 
    
    
    int main( int argc, char** argv )
    { 
    //...
    Maybe you'll find this opencv wiki helpful.

  2. #2
    Registered User
    Join Date
    Jan 2012
    Posts
    3
    Okay I have tried that and now these are the errors I'm getting:


    \documents\visual studio 2010\projects\test_open_cv.cpp(15): error C2065: 'Mat' : undeclared identifier
    \documents\visual studio 2010\projects\test_open_cv.cpp(15): error C2146: syntax error : missing ';' before identifier 'image'
    \documents\visual studio 2010\projects\test_open_cv.cpp(15): error C2065: 'image' : undeclared identifier
    \documents\visual studio 2010\projects\test_open_cv.cpp(16): error C2065: 'image' : undeclared identifier
    \documents\visual studio 2010\projects\test_open_cv.cpp(16): error C3861: 'imread': identifier not found
    \documents\visual studio 2010\projects\test_open_cv.cpp(18): error C2065: 'image' : undeclared identifier
    \documents\visual studio 2010\projects\test_open_cv.cpp(18): error C2228: left of '.data' must have class/struct/union
    1> type is ''unknown-type''
    \documents\visual studio 2010\projects\test_open_cv.cpp(24): error C3861: 'namedWindow': identifier not found
    \documents\visual studio 2010\projects\test_open_cv.cpp(25): error C2065: 'image' : undeclared identifier
    \documents\visual studio 2010\projects\test_open_cv.cpp(25): error C3861: 'imshow': identifier not found
    \documents\visual studio 2010\projects\test_open_cv.cpp(27): error C3861: 'waitKey': identifier not found
    1>
    1>Build FAILED.
    1>

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual Studio 2010 - DirectX compilation error.
    By PieMonster in forum Game Programming
    Replies: 2
    Last Post: 09-04-2011, 01:44 PM
  2. Visual Studio 2010 .exe help
    By omGeeK in forum Game Programming
    Replies: 4
    Last Post: 03-20-2011, 01:36 PM
  3. Replies: 2
    Last Post: 08-28-2010, 12:58 AM
  4. Visual Studio 2010 Help
    By dnelsalty in forum C++ Programming
    Replies: 15
    Last Post: 08-30-2009, 06:07 PM
  5. Windows 7 RC, Visual Studio 2010 Beta, Office 2010 beta, anyone in?
    By indigo0086 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-20-2009, 01:57 PM