Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone...today I've compiled "cvblobslib" for Windows with OpenCV in my Visual Studio C++ 2010.

Compilation goes OK, and I obtain "cvblobslib.lib".

I've follow the istruction on library to set Visual C++ in my project to use this library (C++ additional directories and other) like in the instructions, that I quote here:

"1 - open the project of the library and build it (OK, done)
2 - in the project where the library should be used, add:

2.1 In "Project/Settings/C++/Preprocessor/Additional Include
directories" add the directory where the blob library is stored (done)

2.2 In "Project/Settings/Link/Input/Additional library path" add
the directory where the blob library is stored and in "Object/Library
modules" add the cvblobslib.lib file (where? In the visual studio folder or in my project folder?)

3- Include the file "BlobResult.h" where you want to use blob variables (OK, done)


NOTE: Verify that in the project where the cvblobslib.lib is used, the MFC Runtime Libraries are not mixed:

1. Check in "Project->Settings->C/C++->Code Generation->Use run-time library" of your project and set it to
Debug Multithreaded DLL (debug version ) or to Multithreaded DLL ( release version ).
2 Check in "Project->Settings->General" how it uses the MFC. It should be "Use MFC in a shared DLL". (done)


Can anyones help me, because with this code:

C++
#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <opencv2\highgui\highgui.hpp>
#include <opencv\cxcore.h>
#include <stdio.h>
#include <conio.h>

// Main blob library include
#include "BlobResult.h"


using namespace std;
using namespace cv;


int main()
{

CBlobResult blobs;
int i;
CBlob *currentBlob;
IplImage *original,*originalThr,*displayedImage;

//carica immagine
original = cvLoadImage("pic6.png", CV_LOAD_IMAGE_GRAYSCALE);
cvThreshold(original,originalThr,100,255,CV_THRESH_BINARY);

//cerca le blob non bianche
blobs = CBlobResult(originalThr,NULL,255);

//le esclude quelle più piccole del parametro 2
blobs.Filter(blobs, B_EXCLUDE, CBlobGetArea(), B_LESS, 80);

//prende le parti grigie delle blob più grandi
CBlob biggestBlob;
CBlobGetMean getMeanColor(original);
double meanGray;

blobs.GetNthBlob(CBlobGetArea(), 0, biggestBlob);
meanGray = getMeanColor(biggestBlob);

//display it
cvMerge(originalThr,originalThr,originalThr,NULL, displayedImage);

for(i=0; i<blobs.GetNumBlobs();i++)
{
	currentBlob = blobs.GetBlob(i);
	currentBlob->FillBlob(displayedImage, CV_RGB(255,0,0));
}

return 0;

}


I obtain this errors:

C++
1>------ Inizio compilazione: Progetto: prova64, Configurazione: Debug x64 ------
1>Compilazione avviata 13/09/2013 15:31:44.
1>InitializeBuildStatus:
1>  Aggiornamento timestamp di "x64\Debug\prova64.unsuccessfulbuild".
1>ClCompile:
1>  Tutti gli output sono aggiornati.
1>ManifestResourceCompile:
1>  Tutti gli output sono aggiornati.
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: __cdecl CBlob::~CBlob(void)" (??1CBlob@@QEAA@XZ) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: void __cdecl CBlob::FillBlob(struct _IplImage *,struct CvScalar,int,int)" (?FillBlob@CBlob@@QEAAXPEAU_IplImage@@UCvScalar@@HH@Z) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: class CBlob * __cdecl CBlobResult::GetBlob(int)" (?GetBlob@CBlobResult@@QEAAPEAVCBlob@@H@Z) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: void __cdecl CBlobResult::GetNthBlob(class COperadorBlob *,int,class CBlob &)const " (?GetNthBlob@CBlobResult@@QEBAXPEAVCOperadorBlob@@HAEAVCBlob@@@Z) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: __cdecl CBlob::CBlob(void)" (??0CBlob@@QEAA@XZ) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: void __cdecl CBlobResult::Filter(class CBlobResult &,int,class COperadorBlob *,int,double,double)" (?Filter@CBlobResult@@QEAAXAEAV1@HPEAVCOperadorBlob@@HNN@Z) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: virtual __cdecl CBlobResult::~CBlobResult(void)" (??1CBlobResult@@UEAA@XZ) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: class CBlobResult & __cdecl CBlobResult::operator=(class CBlobResult const &)" (??4CBlobResult@@QEAAAEAV0@AEBV0@@Z) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: __cdecl CBlobResult::CBlobResult(struct _IplImage *,struct _IplImage *,unsigned char)" (??0CBlobResult@@QEAA@PEAU_IplImage@@0E@Z) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: __cdecl CBlobResult::CBlobResult(void)" (??0CBlobResult@@QEAA@XZ) non risolto nella funzione main
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: double __cdecl CBlob::Mean(struct _IplImage *)" (?Mean@CBlob@@QEAANPEAU_IplImage@@@Z) non risolto nella funzione "public: virtual double __cdecl CBlobGetMean::operator()(class CBlob &)" (??RCBlobGetMean@@UEAANAEAVCBlob@@@Z)
1>testeblob.obj : error LNK2019: riferimento al simbolo esterno "public: double __cdecl CBlob::Area(void)" (?Area@CBlob@@QEAANXZ) non risolto nella funzione "public: virtual double __cdecl CBlobGetArea::operator()(class CBlob &)" (??RCBlobGetArea@@UEAANAEAVCBlob@@@Z)
1>C:\OPENCV\Test\Elabora64\prova64\x64\Debug\prova64.exe : fatal error LNK1120: 12 esterni non risolti
1>
1>Compilazione NON RIUSCITA.
1>
1>Tempo trascorso 00:00:00.81
========== Compilazione: 0 completate, 1 non riuscite, 0 aggiornate, 0 ignorate ==========


Why I obtain "external link error" ??

Please, help me...I don't know what to do...
Posted
Updated 18-Sep-13 5:03am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900