Ask Your Question
0

vs 2012 express opencv configuration issue

asked 2013-09-29 02:07:03 -0600

luishasbon gravatar image

Hello readers!

I am using opencv 2.4.6 x64 edition on VS 2012 express I have already added the include paths in project properties C:/opencv/build/include in VC++ conf and C++ conf, also I have already added the lib path to the linker C:\opencv\build\x64\vc11\lib and added the inputs... opencv_imgproce2.4.6...etc.

When I try to compile a simple code it shows some errors like these: Error 1 error LNK2019: unresolved external symbol _cvShowImage referenced in function _main C:\Users\User\Documents\Workspace\CV_Test1\CV_Test1\ Source.obj CV_Test1

Please help to understand why is this happening, and tell me what do you think I should do?

I have already added also to the system Path var this: "C:\opencv\build\x64\vc11\bin"

edit retag flag offensive close merge delete

Comments

Did you add opencv_highgui246.lib?

Vladislav Vinogradov gravatar imageVladislav Vinogradov ( 2013-09-29 05:02:05 -0600 )edit

Thank you Vladislav I have already added it.

luishasbon gravatar imageluishasbon ( 2013-09-29 20:10:13 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2013-09-29 05:12:18 -0600

FLY gravatar image

updated 2013-09-29 05:23:43 -0600

unresolved external symbol means that You're not linking with required library. If you DID explicitly set up linking with all the necessary libraries, but linking errors still show, you might be mixing up 64/32 bit libraries and application.

I.e. make sure that all library includes point to 64 bit version of libraries if you are building 64 bit application

You can also get help from here

edit flag offensive delete link more

Comments

Thank you for your kind response, I think I am using always the 64 bit edition, the path I use always is "C:\opencv\build\x64\vc11" but I will double check and I will tell you. In any case, I was wondering if maybe I need to configure VS2012 build conf in order to specify a 64bit build.

luishasbon gravatar imageluishasbon ( 2013-09-29 20:09:22 -0600 )edit

Also, maybe, is there the need of configuring the path variable to "C:\opencv\build\x64\vc11\bin" I was wondering how is going to find the linker the dlls? in the CV tutorials page, regarding the Path system var it only says that one must add this "C:\opencv\build\x64\vc11\"

luishasbon gravatar imageluishasbon ( 2013-09-29 20:13:17 -0600 )edit

Indeed FLY, it was a bad project configuration, I was building with 32b settings. Sorry I am new to 64 bit projects in VS2012.

luishasbon gravatar imageluishasbon ( 2013-09-29 20:34:49 -0600 )edit
0

answered 2013-11-04 09:01:47 -0600

tstephens gravatar image

updated 2013-11-04 09:04:13 -0600

I had 285 Errors in the link, but after switching the "Runtime library" option from "Multi-threaded Debug DLL (/MDd)" to "Multi-threaded Debug (/MTd)", then I had only 133 Errors.

Then, after adding 6 more libraries from the same staticlib directory...

ilmimfd.lib libjasperd.lib libjpegd.lib libpngd.lib libtiffd.lib zlibd.lib

...and 2 more libraries that come from windows...

comctl32.lib vfw32.lib

...it now compiles, but there are a boatload of warnings of the type:

1>opencv_core246d.lib(alloc.obj) : warning LNK4099: PDB 'opencv_core246d.pdb' was not found with 'opencv_core246d.lib(alloc.obj)' or at 'c:\users\trevor\documents\visual studio 2012\Projects\vipsSample\Debug\opencv_core246d.pdb'; linking object as if no debug info

1>opencv_core246d.lib(arithm.obj) : warning LNK4099: PDB 'opencv_core246d.pdb' was not found with 'opencv_core246d.lib(arithm.obj)' or at 'c:\users\trevor\documents\visual studio 2012\Projects\vipsSample\Debug\opencv_core246d.pdb'; linking object as if no debug info

1>opencv_core246d.lib(array.obj) : warning LNK4099: PDB 'opencv_core246d.pdb' was not found with 'opencv_core246d.lib(array.obj)' or at 'c:\users\trevor\documents\visual studio 2012\Projects\vipsSample\Debug\opencv_core246d.pdb'; linking object as if no debug info

The sample program does run now though.

edit flag offensive delete link more
-1

answered 2013-11-04 07:49:30 -0600

tstephens gravatar image

I have the same issue. Tried to build with the x64 under Win32/x86. Then I switched it, but get many of the following errors:

Error 1 error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in vipsSample.obj c:\Users\Trevor\documents\visual studio 2012\Projects\vipsSample\vipsSample\opencv_core246d.lib(alloc.obj) vipsSample

I know that there must be some VC switch to change "MD" to "MT", but I cannot find it.

Any help would be appreciated.

edit flag offensive delete link more

Comments

@tstephens Kindly post the new thread from you id to get the answer , this is not the way to post your question on some one's thread

FLY gravatar imageFLY ( 2013-11-04 10:10:56 -0600 )edit

Sure. thanks

tstephens gravatar imagetstephens ( 2013-11-04 11:16:05 -0600 )edit

Question Tools

Stats

Asked: 2013-09-29 02:07:03 -0600

Seen: 1,525 times

Last updated: Nov 04 '13