Results 1 to 5 of 5

Thread: C2871 Error : namespace doesnot exist

  1. #1
    Join Date
    Aug 2012
    Location
    Kuala Lumpur, Malaysia
    Posts
    9
    Thanks
    8
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Unhappy C2871 Error : namespace doesnot exist

    Hi guys,

    I have some problem with external lib.. i try to include external lib into my project but it producing this C2871 error.
    C:\Qt\OpenCVProject\20150505_23_Vid\mainwindow.h:9 : error: C2871: 'Videoman' : a namespace with this name does not exist
    I already include the related .h file but its still showing the error.. What should i do? Where did i do wrong?

    this is my .pro file
    Qt Code:
    1. QT += core gui opengl xml
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    4.  
    5. TARGET = uEyeCam
    6. TEMPLATE = app
    7.  
    8.  
    9. SOURCES += main.cpp\
    10. mainwindow.cpp
    11.  
    12. HEADERS += mainwindow.h
    13.  
    14. FORMS += mainwindow.ui
    15.  
    16. win32:CONFIG(release, debug|release): LIBS += -LC:/OpenCV/VideoMan1.1/build/lib/ -lVideoMan
    17. else:win32:CONFIG(debug, debug|release): LIBS += -LC:/OpenCV/VideoMan1.1/build/lib/ -lVideoMand
    18.  
    19. INCLUDEPATH += C:/OpenCV/VideoMan1.1/include
    20. DEPENDPATH += C:/OpenCV/VideoMan1.1/include
    To copy to clipboard, switch view to plain text mode 

    my .h file
    Qt Code:
    1. #include <QMainWindow>
    2. #include "VideoManControl.h"
    3. #include "VideoManInputFormat.h"
    4.  
    5. using namespace std;
    6. using namespace Videoman;
    7.  
    8. namespace Ui {
    9. class MainWindow;
    10. }
    11.  
    12. class MainWindow : public QMainWindow
    13. {
    14. Q_OBJECT
    15.  
    16. public:
    17. explicit MainWindow(QWidget *parent = 0);
    18. ~MainWindow();
    19.  
    20. private slots:
    21. void on_displayButton_clicked();
    22. void openCamera();
    23.  
    24. private:
    25. Ui::MainWindow *ui;
    26. };
    To copy to clipboard, switch view to plain text mode 

    and VideoManControl.h file
    Qt Code:
    1. #ifndef VIDEOMANCONTROL_H
    2. #define VIDEOMANCONTROL_H
    3.  
    4. #ifdef WIN32
    5. #ifdef VideoMan_EXPORTS
    6. #define VIDEOMAN_API __declspec(dllexport)
    7. #else
    8. #define VIDEOMAN_API __declspec(dllimport)
    9. #endif
    10. #endif
    11. #ifdef linux
    12. #define VIDEOMAN_API
    13. #endif
    14.  
    15. #include "VideoManInputFormat.h"
    16.  
    17. namespace VideoManPrivate
    18. {
    19. class VideoManControlPrivate;
    20. class VideoManInputController;
    21. };
    22.  
    23. namespace VideoMan
    24. {
    25. ///////---------related code-------------///////
    26. };
    27. #endif
    To copy to clipboard, switch view to plain text mode 

    thanks in advance..
    A little knowledge that acts is worth infinitely more than much knowledge that is idle
    Regards..

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: C2871 Error : namespace doesnot exist

    Typo in namespace name.
    VideoMan vs Videoman

    Cheers,
    _

  3. #3
    Join Date
    Aug 2012
    Location
    Kuala Lumpur, Malaysia
    Posts
    9
    Thanks
    8
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: C2871 Error : namespace doesnot exist

    Quote Originally Posted by anda_skoa View Post
    Typo in namespace name.
    VideoMan vs Videoman

    Cheers,
    _
    OMG!!! thank you so much...

    spending days trying to include the library..
    after get rid of include error, error cant used the namespace appeared...
    mybe i over think this... this is embarrassing..
    Last edited by snow_starzz; 13th May 2015 at 08:30.
    A little knowledge that acts is worth infinitely more than much knowledge that is idle
    Regards..

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: C2871 Error : namespace doesnot exist

    mybe i over think this... this is embarrassing..
    There isn't a single one of us here that hasn't been there and done this.

  5. #5
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: C2871 Error : namespace doesnot exist

    spending days trying to include the library..
    Try using a nice code editor with code completion feature - this way you can just type "using namespace Vid" and press ctrl+space

Similar Threads

  1. Error: dependent '..\HosneYosef\TitleHelp.png' does not exist.
    By complexcoding in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2013, 12:19
  2. File does not exist error with rcc.exe
    By JB_Trace in forum Newbie
    Replies: 1
    Last Post: 6th November 2012, 16:20
  3. Namespace error in qt
    By ehnuh in forum Qt Programming
    Replies: 0
    Last Post: 25th October 2012, 13:09
  4. error: ‘QtMobility’ is not a namespace-name
    By TheIndependentAquarius in forum Qt Programming
    Replies: 0
    Last Post: 18th May 2011, 09:56
  5. Replies: 13
    Last Post: 4th November 2010, 22:34

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.