How to correct this error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to correct this error

manishchowdhury_2005
ERROR Showing is:::::--------

Build Log

------- Build started: Project: Hello, Configuration: Debug|Win32 -----

Command Lines

Creating temporary file "c:\OpenCV Projects\Hello\Hello\Debug\RSP000006.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MLd /Yu"stdafx.h" /Fp"Debug/Hello.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
".\Hello.cpp"
]
Creating command line "cl.exe @"c:\OpenCV Projects\Hello\Hello\Debug\RSP000006.rsp" /nologo"

Output Window

Compiling...
Hello.cpp
c:\OpenCV Projects\Hello\Hello\Hello.cpp(17) : error C2664: 'cvReleaseImage' : cannot convert parameter 1 from 'const char [7]' to 'IplImage ** '
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\OpenCV Projects\Hello\Hello\Hello.cpp(18) : error C2664: 'cvDestroyWindow' : cannot convert parameter 1 from 'IplImage **__w64  ' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


Results


Build log was saved at "file://c:\OpenCV Projects\Hello\Hello\Debug\BuildLog.htm"
Hello - 2 error(s), 0 warning(s)


::::::::::::::::------------------------------------------------------

Now my problem is My deskstop is 64 bit .
Due to which,  i am  facing problem of this type of error ??. i don't know . please help me !!!! . i am using in Microsoft.Net Framework 1.1  version 1.1.4322 SP1

My program is ::::::----

// Hello.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <cv.h>
#include <cxcore.h>
#include <highgui.h>

int _tmain(int argc, _TCHAR* argv[])
{
    IplImage *img = cvLoadImage("Image.bmp" );
        cvNamedWindow( "Image:", 1 );
        cvShowImage( "Image:", img );
   
        cvWaitKey();
        cvReleaseImage("Image:");
    cvDestroyWindow( &img );

        return 0;
}


Reply | Threaded
Open this post in threaded view
|

Re: How to correct this error

Jean-Pierre Landry
Looks like you inverted the window and the image at the end of the
program...

cvReleaseImage("Image:");  should be  cvReleaseImage(&img);

and

cvDestroyWindow( &img );   should be cvDestroyWindow("Image:");


manishchowdhury_2005 wrote:

> ERROR Showing is:::::--------
>
> Build Log
>
> ------- Build started: Project: Hello, Configuration: Debug|Win32 -----
>
> Command Lines
>
> Creating temporary file "c:\OpenCV Projects\Hello\Hello\Debug\RSP000006.rsp" with contents
> [
> /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MLd /Yu"stdafx.h" /Fp"Debug/Hello.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
> ".\Hello.cpp"
> ]
> Creating command line "cl.exe @"c:\OpenCV Projects\Hello\Hello\Debug\RSP000006.rsp" /nologo"
>
> Output Window
>
> Compiling...
> Hello.cpp
> c:\OpenCV Projects\Hello\Hello\Hello.cpp(17) : error C2664: 'cvReleaseImage' : cannot convert parameter 1 from 'const char [7]' to 'IplImage ** '
>         Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
> c:\OpenCV Projects\Hello\Hello\Hello.cpp(18) : error C2664: 'cvDestroyWindow' : cannot convert parameter 1 from 'IplImage **__w64  ' to 'const char *'
>         Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
>
>
> Results
>
>
> Build log was saved at "file://c:\OpenCV Projects\Hello\Hello\Debug\BuildLog.htm"
> Hello - 2 error(s), 0 warning(s)
>
>
> ::::::::::::::::------------------------------------------------------
>
> Now my problem is My deskstop is 64 bit .
> Due to which,  i am  facing problem of this type of error ??. i don't know . please help me !!!! . i am using in Microsoft.Net Framework 1.1  version 1.1.4322 SP1
>
> My program is ::::::----
>
> // Hello.cpp : Defines the entry point for the console application.
> //
>
> #include "stdafx.h"
>
> #include <cv.h>
> #include <cxcore.h>
> #include <highgui.h>
>
> int _tmain(int argc, _TCHAR* argv[])
> {
>     IplImage *img = cvLoadImage("Image.bmp" );
> cvNamedWindow( "Image:", 1 );
> cvShowImage( "Image:", img );
>    
> cvWaitKey();
> cvReleaseImage("Image:");
>     cvDestroyWindow( &img );
>
> return 0;
> }
>
>
>
>
> ------------------------------------
>
> Change settings: http://www.yahoogroups.com/mygroups, select
>    Get Emails (get all posts)
>    Daily Digest (one summary email per day)
>    Read on the web (read posts on the web only)Or Unsubscribe by mailing [hidden email]