Linkage problem

Hey guys, im having this problem:

  
cvCreateGaussianBGModel(Img.getCvImage());  

get this error:

  
undefined reference to `cvCreateGaussianBGModel'  

i have the cv and cvaux headers, and im linking opencv in the makefile (OpenCV 2.1 not the OF one).

what i dont understand is if i change the code this way:

  
cvCreateGaussianBGModel();  

and get this:

  
error: too few arguments to function ‘CvBGStatModel* cvCreateGaussianBGModel(IplImage*, CvGaussBGStatModelParams*)  

So it is referenced?!
Has anyone had this problem?

Now im using opencv from OF and i get the same error.

The function is being found in one of the header files you are including, but it is not being found during linking. You need to link to the appropriate openCV library…cvaux maybe?

error: too few arguments to function

This just means that the function was found, but you are not calling it properly.

hey, thanks for your relpy

[quote author=“grimus”]The function is being found in one of the header files you are including, but it is not being found during linking. You need to link to the appropriate openCV library…cvaux maybe?

error: too few arguments to function

This just means that the function was found, but you are not calling it properly.[/quote]

Yes i did it on purpose, to see if it gave the same error, and yes it is a linkage problem because i tried other cvaux functions with the same error, cv.h functions work just fine. What i dont understand is that im using cvaux the same way i use cv.

Corrected.

I was doing the linking manualy in the makefile, dont know why it didnt work.

For future people with the same problem:

In codeblocks go to Project > Build options > Linker settings press Add.
next browse to the addons>ofxOpenCv>libs>lib and choose the libs you want.

press OK and your ready to go.