Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4074186
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:07:57+00:00 2026-05-20T17:07:57+00:00

I’m getting confused about the scope of ‘using namespace’ declarations… hoping someone can clear

  • 0

I’m getting confused about the scope of ‘using namespace’ declarations… hoping someone can clear this up for me!

I’m using two libraries (OpenCV and Ogre3D). I have two cpp files, one uses exclusively OpenCV (PoseEstimator.cpp) and the other exclusively Ogre3D (OgreLogic.cpp).

The top of OgreLogic.cpp looks like this:

#include "stdafx.h"

#include "PoseEstimator.h"
#include "OgreLogic.h"

using namespace Ogre;

And the top of PoseEstimator.cpp looks like this:

#include "StdAfx.h"
#include "PoseEstimator.h"

using namespace cv;
using namespace std;

This ‘using namespace cv’ is the only occurrence in the whole project (I double checked by doing a search). The are no ‘using namespace’s in headers, only ever in cpp files.

However, when compiling OgreLogic.cpp I get ambiguity errors, e.g.:

cxmat.hpp(3465) : error C2872: ‘uchar’
: ambiguous symbol 1> could be
‘d:\libraries\opencv2.1\include\opencv\cxtypes.h(154)
: unsigned char uchar’ 1> or
‘d:\libraries\ogresdk\include\ogre\OgrePrerequisites.h(106)
: Ogre::uchar’

I seem to be misunderstanding something, because I think this should be OK?

Any help greatly appreciated!

Thanks,

Jack

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:07:58+00:00Added an answer on May 20, 2026 at 5:07 pm

    It looks like what is happening is you have a line declaring a uchar, e.g. uchar x = 12 or something. At the top of your file, you’ve specified that you’re using the Ogre namespace. The compiler is running into a problem determining which uchar you’re using – the cxtypes.h one or the Ogre::uchar.

    Try taking out the using namespace Ogre; and do your function calls as Ogre::doStuff() to remove ambiguity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.