Export to GitHub

cvblob - issue #34

LINK : fatal error LNK1104: cannot open file '..\lib\Debug\cvblob.lib' on windows platform!


Posted on Oct 23, 2012 by Helpful Ox

LINK : fatal error LNK1104: cannot open file '..\lib\Debug\cvblob.lib'

Comment #1

Posted on Nov 6, 2012 by Helpful Bear

I got the same error in visual studio 2010. The problem is that visual studio does not create a lib file unless functions are explicitly defined as dllexport functions. To fix this add the following to cvblob.h:

define EXPORT __declspec (dllexport)

In the extern "C" block, add the word EXPORT to each function. For example: EXPORT double cvContourPolygonArea(CvContourPolygon const *p);

As soon as you add at least one EXPORT keyword the .lib file will be created. You should add EXPORT to all the functions in the extern "C" block though, otherwise you will get linkage errors for the functions you didn't add EXPORT for.

This fix was based on the following MSDN post: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/15e4fc47-68b5-4798-9e5d-d6d72da1f631/

Comment #2

Posted on Nov 16, 2012 by Swift Lion

thanks

Comment #3

Posted on Mar 22, 2013 by Quick Panda

thanks. now it builds successfully

Status: New

Labels:
Type-Defect Priority-Medium