Ambiguous symbol in code.....
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Ambiguous symbol in code.....

  1. #1
    Join Date
    Jan 2014
    Posts
    3

    Exclamation Ambiguous symbol in code.....

    I am working on my project of gesture recognition using c++ and open cv and i am also designing GUI simultaneously.
    I am using system namespace for GUI part and cv namespace for gestures.
    After compiling i am getting error as Ambiguous symbol String is used.
    Can anyone help me to solve this error.
    This the link for msdn error help :
    http://msdn.microsoft.com/en-us/library/t57wswcs.aspx

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,605

    Re: Ambiguous symbol in code.....

    Quote Originally Posted by DevendraM View Post
    ...
    Can anyone help me to solve this error.
    This the link for msdn error help :
    http://msdn.microsoft.com/en-us/library/t57wswcs.aspx
    I don't understand: if this link does help then why do you ask?
    If it does NOT help you then, please post your code that produces this error.
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2014
    Posts
    3

    Re: Ambiguous symbol in code.....

    This is error
    Name:  Fullscreen capture 1122014 34549 PM.jpg
Views: 105
Size:  60.6 KB
    I am attaching code also..
    Code:
    private: System::Void pictureBox3_Click(System::Object^  sender, System::EventArgs^  e) {
    				if(i<100)
    				{
    					this->progressBar1->Increment(5);
    					this->i=this->i+5;
    					String^ S=String::Format("{0}",i);
    					this->button1->Text=S;
    				}
    				else
    				{
    					String^ S=String::Format("Can not increment value beyond 100");
    					MessageBox::Show(S);
    				}
    			 }
    For the string variable i used here i am getting error
    I have used cv namespace and system name space

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,605

    Re: Ambiguous symbol in code.....

    It is not a native C++ code. It is a manged one. So it should be discussed in a corresponding Forum.
    Victor Nijegorodov

  5. #5
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,594

    Re: Ambiguous symbol in code.....

    You can't have using directives for both the System and cv namespaces in the same compilation unit (speaking simplified: source file) or you must explicitly qualify the the String class you're actually meaning by its namespace, i.e. System::String if you want the one from the .NET Framework Library. I don't know OpenCV myself; there may be other class names conflicting with .NET classes you'll need to qualify.

    Alternatively, you may simply omit the using namespace cv; and use the .NET framwork String class as usual, but then you'll need to explicitly qualify any OpenCV class (or free function or global variable) you use.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  6. #6
    Join Date
    Jan 2014
    Posts
    3

    Re: Ambiguous symbol in code.....

    Thanx..
    It worked...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center