Opencv and gtkmm dont seem to get along... why??

Hey guys, so I am currently making a program that needs both gtkmm (for the control pannel) and opencv to function. what i have done is to make two separate threads, using pthreads, for each of these; when i run the thread using gtkmm, creating the window, alone, it goes just fine. same with the opencv thread- when alone, both run fine.

the problem i encounter, however, comes when i try to run the two in unison. the gtkmm thread fails, and the program aborts. i have traced the error to a function cvwaitkey(); when this is not present in the opencv thread, both run flawlessly. here is the error that i get:

g_main_context_prepare(): main loop already active in another thread

or a host of other errors. what could be the problem?? thanks in advance!


Topic archived. No new replies allowed.