Ask Your Question

Revision history [back]

So, I know it's been a while since this was posted but I recently had the same issue and decided to share what I found.

Anyway, I just got an OpenCV 2.4.9 x64 build working with OpenGL and Cuda (v6.5) for Visual Studio 2012. Additionally, I have a NVIDIA fermi architecture in my lab, and a kepler at home, so I built both. Now, when I first started, the CMake generated VS2012 solution actually built, but with some errors. Upon trying to fix the errors I got the unresolved externals in the highgui module.

Anyway, many hours later I discovered that one of the projects (Didn't try to discover which one) reconfigures the CMake solution and disabled both the HAVE_WIN32UI and HAVE_VFW #defines in cvconfig.h. Without HAVE_WIN32UI, window_w32.cpp isn't included as a source file which explains why the implementations are missing for the functions the linker is complaining about.

So... what to do. Well, don't build the "ALL_BUILD" or "INSTALL" projects unless you want to actually figure out WHY the reconfiguring is happening. I'm perfectly open to the fact that I might have screwed something up or don't have some dependency here or there, these custom builds seem to be extremely fussy and I'm a moderate programmer at best. Instead, manually build each of the module objects. Of course, I'm only interested in the DLLs, LIBs, and INCLUDE folders, not any of the compiled examples, etc. You'll have to do more work if you need them.

Here's how I built the solution (only did release as I haven't gotten to debug yet): Under "Solution->modules" build in this order: opencv_highgui, opencv_calib3d, opencv_contrib, opencv_stitching, opencv_superres, opencv_ts, opencv_videostab.

*Note that opencv_ts actually does a CMake reconfiguration but didn't change HAVE_WIN32UI, HAVE_VFW, or any of the so-far compiled projects, so I let it be.

*Note: I bet any order would work, it seems to be one of the non module projects that is the culprit here.

Again, I got what I needed for a work project so I stopped here. I tested the GPU functionality by using an RGB video frame I grab as usual with a cv::VideoCapture object. I created a gpu::GpuMat and uploaded a grayscale converted copy of my cv::mat video frame to it. I applied an x and y gpu::Sobel operator to the image, created a couple more cv::Mats to grab the result, weighted them together and displayed using imshow. That all sounds really convoluted, I know, but I just grabbed the first image processing example I could find to figure out whether or not the hours of work I put into figuring this problem out were worth it. Apparently they were.

Hope that helps. Also, if anybody out there has some good feedback on what I found and anything I misinterpreted, etc. I would really like to hear it.