Ask Your Question
0

Error OpenCV with Windows Application - Urgent Please [closed]

asked 2013-10-16 08:34:30 -0600

Jack Chung gravatar image

updated 2013-10-16 08:54:10 -0600

Hello Guys,

I was using the OpenCV in Console Application and it was working fine, now I have to use Windows Application because I am doing a GUI to work with OpenCV, but it is showing an error.

Please guys it is urgent, I would appreciate it if someone could help me to solve that.

Thank you

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by StevenPuttemans
close date 2013-10-17 07:00:00.050181

Comments

I am closing this topic, since you are just spamming questions and it doesn't have a single meaning. Stick to one topic and please be patient ...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-10-17 06:58:46 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-10-16 08:48:53 -0600

berak gravatar image

updated 2013-10-16 08:50:48 -0600

you either want:

int WINAPI WinMain(HINSTANCE hinst, HINSTANCE previnst, LPSTR cmdline, int cmdshow)

instead of

int main()

or change your application type to SUBSYSTEM:CONSOLE

( as a sidenote: your problem is as urgent as anyone else's here. "yelling" like this might even put some people off )

edit flag offensive delete link more

Comments

How can I change the application type to SUBSYSTEM:CONSOLE? I am using Visual Studio.

Thanks for the fast answer

Jack Chung gravatar imageJack Chung ( 2013-10-16 08:55:39 -0600 )edit

linker -> system -> subsystem ( but i got only 2008 here )

actually, if you want a console window for printf style output, choose this. if you don't want to see it, choose WinMain

berak gravatar imageberak ( 2013-10-16 09:01:03 -0600 )edit

Well I have to use Windows Application because I want to do a GUI, that will choose what image I will load with OpenCV. Then I will need to use WinMain right?

Could you explain those parameters, please? I didn't understand them.

Jack Chung gravatar imageJack Chung ( 2013-10-16 09:08:56 -0600 )edit

man, you should have looked it up yourself.

again,

  • if you got SUBSYSTEM:WINDOWS, there's no console win, and you need to use WinMain
  • if you got SUBSYSTEM:CONSOLE, there's a console win, and you usually use main(), but you still can use WinMain, depending on what you want here
berak gravatar imageberak ( 2013-10-16 09:22:40 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-10-16 08:34:30 -0600

Seen: 524 times

Last updated: Oct 16 '13