News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Can't link to the OpenCV library ml with codeblocks

Started by Rene, July 24, 2009, 01:03:33 AM

Previous topic - Next topic

Rene

Hello,

I'm using OpenCV with Codeblocks and all works fine. But now I need a boosting algorithm out of the machine learning library. I want to link the ml library like I did it with all the other libraries from Opencv (just link them in the linker settings like -lcv -lhighgui ...) but it didn't work. I always get a linker error. I put the build log below. I tried it under linux and it works, but I have to use VISTA.

Someone have an idea?

Thanks

the main:

#include <iostream>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <ml.h>

using namespace std;

int main()
{
    CvBoost boost;

    return 0;
}


and the build log:
-------------- Build: Debug in testBoost ---------------

mingw32-g++.exe -L"C:\Program Files\OpenCV\lib"  -o bin\Debug\testBoost.exe obj\Debug\main.o   -lcv -lcvaux -lcxcore -lhighgui -lml 
obj\Debug\main.o: In function `main':
C:/Users/jwie015/Test/testBoost/main.cpp:11: undefined reference to `CvBoost::CvBoost()'
C:/Users/jwie015/Test/testBoost/main.cpp:13: undefined reference to `CvBoost::~CvBoost()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings

Rene

Nobody has an idea? or tried to link to the machine learning library?

oBFusCATed

Have you tried:

nm my_lib | grep -i CvBoost

replace my_lib with all the libs you are linking.

nm is part of mingw, grep you can find with this google query: "grep for win32"
The command is issued in cmd window (window button + r -> cmd -> hit enter)

This is the algorithm I use to debug such problems

Best regards


(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

Quote from: oBFusCATed on July 28, 2009, 11:48:41 PM
Have you tried:

nm my_lib | grep -i CvBoost

replace my_lib with all the libs you are linking.

nm is part of mingw, grep you can find with this google query: "grep for win32"
The command is issued in cmd window (window button + r -> cmd -> hit enter)

This is the algorithm I use to debug such problems

Best regards




You can do something similar with the "Symbol Table Plugin", reachable via the "Plugins" menu in C::B, it also uses nm, but you can set some options to make search more comfortable, and you don't need to leave C::B to do so  :wink: .