Tuesday, January 9, 2007

Battles With OpenCV and MS Visual Studio 2005

So I just loaded Microsoft Visual Studio 2005. The first time I tried to do this I failed because one of the installation CDs was warped! Thankfully the second set of install CDs was defect free. Next, I installed OpenCV and tried to integrate it into Visual Studios. I used qevanblog's blog to help guide me through the integration process. However, I think that the integration guide at sourceforge is a bit easier to understand. Of course OpenCV always loves to throw a curveball every now and again and it did so this time by complaining about missing DLLs (specifically highgui100.dll, cxcore100.dll, and libguide40.dll). My solution was to copy those DLLs to the directory of the executable I was building. I spent a bunch of time trying to have Visual Studios fold those DLLs into the executable as part of the build process but was unable to get that to work. Hopefully I will come up with a more practical solution in the near future.

EDIT:
I got some good advice from Thomas on how to fix my DLL problem. He suggested that I include the path to the directory that holds the DLLs in my environmental variables. Interestingly enough, when I went to go add the path to my environmental variables I found that it was already there. So I restarted Visual Studios, recompiled the test program and the thing actually worked. My guess is that my system was set up properly the whole time and I just did something stupid like not restarting or not reloading Visual Studios. Meh.

2 comments:

Nick True said...

1) Because I've used/am using eclipse and what to try out MSVS.
2) Because I've worked at getting OpenCV to work with eclipse and found it to be an annoying experience.

Vinay B N said...

Hey can you mail me the above code??
Cuz m working on the same for my fifth sem mini-project!!
And ma e-ID is vinay_bn@ymail.com
Thnx in Advance :)