Ask Your Question
2

OpenCV with Qt support namedWindow crash

asked 2012-07-16 09:26:35 -0600

frondeur gravatar image

updated 2012-07-24 02:36:07 -0600

Kirill Kornyakov gravatar image

Hi,

I've opencv 2.4.2 build with visual studio 2010 and CMAKE (qt support enabled). Whenever, i use a simple program opening a window/use imshow then i get unhandled exception crash and in the terminal window i get opencv error :

OpenCV error: Null pointer <null session="" handler=""> in unknown function, file, pathtoopencv\highgui\src\window_qt.cpp line 909

The same program with the same configuration settings work in 'Release' configuration. It only fails in Debug mode. I also tried to build the opencv with SSE/SSE2 disabled but still am getting the crash.

Regards,

edit retag flag offensive close merge delete

Comments

Can you please post whole CMAKE configuration? I compiled the openCV with Qt like two weeks ago, I remember I had some kind of problems too, not exactly like yours, but I fixed it by rolling back a version and changed something in cmake configuration, I should still have it I'll take a look.

XCoder gravatar imageXCoder ( 2012-07-16 09:31:00 -0600 )edit

I am having the same problem, any update on the situation?

Baris Evrim Demiroz gravatar imageBaris Evrim Demiroz ( 2012-08-08 10:12:31 -0600 )edit

Try rolling back a version if you are using 2.4.2. The compiling part, at least for me, is always a very tricky thing to do.

XCoder gravatar imageXCoder ( 2012-08-09 03:09:38 -0600 )edit

4 answers

Sort by ยป oldest newest most voted
1

answered 2012-08-09 09:26:18 -0600

Baris Evrim Demiroz gravatar image

I have found the problem and a workaround.

In OpenCV solution, in opencv_highgui Debug properties, remove QtCore4.dll from the Linker->Input->Additional Dependencies. Recompile OpenCV-Debug. Use the new dll files.

I have also filed a bug report here.

edit flag offensive delete link more
0

answered 2013-03-05 21:48:07 -0600

Jevin gravatar image

Check out the following video about configuring opencv and QT

http://www.youtube.com/watch?v=0ONxIy8itRA

helped me a lot hope will do same for you ;-)

edit flag offensive delete link more
0

answered 2012-07-23 03:54:01 -0600

XCoder gravatar image

updated 2012-07-23 03:56:09 -0600

Well I'm not exactly sure what causes your problem, I compared my CmakeCache with yours, and it looks like you have compiled a lot of plugins inside Qt. This experiment might take a half a day :), but maybe try recompiling Qt with the configuration like in the installation documentation:

configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools
              -no-qt3support -no-multimedia -no-ltcg

Check if your environment variable called QTDIR, and environment path pointing something similar to this:

C:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\bin

Another thing I saw, your CUDA might not be working. By the way, what compiler were you using to compile OpenCV?

It might help you to compare those cmake files yourself, download notepad++ and install compare plugin, and here are my and your CMakeCache files and text document pointing out differences worth taking a deeper look into: cmakecaches.rar

Maybe try, to follow the instruction videos again in the installation documentation, maybe you missed something, anyway GOOD LUCK.

edit flag offensive delete link more
-2

answered 2012-07-21 13:09:29 -0600

frondeur gravatar image

Sorry for late reply, i forgot to check the follow on for the message. I tried to upload the cmakecache.txt, if it is what you meant by config but i can not upload it due to forum restrictions. So i am posting it here.

# This is the CMakeCache file.
# For build in directory: c:/opencv/build
# It was generated by CMake: C:/Program Files/CMake 2.8/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//Path to a program.
BIBTEX_COMPILER:FILEPATH=BIBTEX_COMPILER-NOTFOUND

//Create build rules for OpenCV Documentation
BUILD_DOCS:BOOL=ON

//Build all examples
BUILD_EXAMPLES:BOOL=ON

//Build libjasper from source
BUILD_JASPER:BOOL=ON

//Build libjpeg from source
BUILD_JPEG:BOOL=ON

//Enables 'make package_source' command
BUILD_PACKAGE:BOOL=ON

//Build performance tests
BUILD_PERF_TESTS:BOOL=ON

//Build libpng from source
BUILD_PNG:BOOL=ON

//Build shared libraries (.dll/.so) instead of static ones (.lib/.a)
BUILD_SHARED_LIBS:BOOL=ON

//Build accuracy & regression tests
BUILD_TESTS:BOOL=ON

//Build libtiff from source
BUILD_TIFF:BOOL=ON

//Include debug info into debug libs (not MSCV only)
BUILD_WITH_DEBUG_INFO:BOOL=ON

//Enables use of staticaly linked CRT for staticaly linked OpenCV
BUILD_WITH_STATIC_CRT:BOOL=ON

//Build zlib from source
BUILD_ZLIB:BOOL=ON

//Include opencv_calib3d module into the OpenCV build
BUILD_opencv_calib3d:BOOL=ON

//Include opencv_contrib module into the OpenCV build
BUILD_opencv_contrib:BOOL=ON

//Include opencv_core module into the OpenCV build
BUILD_opencv_core:BOOL=ON

//Include opencv_features2d module into the OpenCV build
BUILD_opencv_features2d:BOOL=ON

//Include opencv_flann module into the OpenCV build
BUILD_opencv_flann:BOOL=ON

//Include opencv_gpu module into the OpenCV build
BUILD_opencv_gpu:BOOL=ON

//Include opencv_highgui module into the OpenCV build
BUILD_opencv_highgui:BOOL=ON

//Include opencv_imgproc module into the OpenCV build
BUILD_opencv_imgproc:BOOL=ON

//Include opencv_legacy module into the OpenCV build
BUILD_opencv_legacy:BOOL=ON

//Include opencv_ml module into the OpenCV build
BUILD_opencv_ml:BOOL=ON

//Include opencv_nonfree module into the OpenCV build
BUILD_opencv_nonfree:BOOL=ON

//Include opencv_objdetect module into the OpenCV build
BUILD_opencv_objdetect:BOOL=ON

//Include opencv_photo module into the OpenCV build
BUILD_opencv_photo:BOOL=ON

//Include opencv_stitching module into the OpenCV build
BUILD_opencv_stitching:BOOL=ON

//Include opencv_ts module into the OpenCV build
BUILD_opencv_ts:BOOL=ON

//Include opencv_video module into the OpenCV build
BUILD_opencv_video:BOOL=ON

//Include opencv_videostab module into the OpenCV build
BUILD_opencv_videostab:BOOL=ON

//Semicolon separated list of supported configuration types, only
// supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
// else will be ignored.
CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release

//C++ compiler
CMAKE_CXX_COMPILER:FILEPATH=cl

//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHa /GR

//Flags used by the compiler during debug ...
(more)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-07-16 09:26:35 -0600

Seen: 8,686 times

Last updated: Mar 05 '13