balagosa
October 28th, 2009, 11:32 AM
here's the prob:
#include "cvhaartraining.h"
int main( int argc, char* argv[] )
{
//some piece of code
}
Apparently, in that piece of code is to call a function from cvhaartraining.h. The problem is, it can't locate the header file. I compiled with this parameters.
g++ createsamples.cpp -o createsamples -L/home/daniel/Desktop/opencv/cvhaartraining
I even tried not including the -L option and copying the entire cvhaartraining.h inside the createsamples.cpp. Still an error occurs.
The Error:
/tmp/cczlgy9l.o: In function `main':
createsamples.cpp:(.text+0x8ad): undefined reference to `cvCreateTrainingSamples(char const*, char const*, int, int, char const*, int, int, int, double, double, double, int, int, int)'
createsamples.cpp:(.text+0x94e): undefined reference to `cvCreateTestSamples(char const*, char const*, int, int, char const*, int, int, int, double, double, double, int, int, int)'
createsamples.cpp:(.text+0x9a5): undefined reference to `cvCreateTrainingSamplesFromInfo(char const*, char const*, int, int, int, int)'
createsamples.cpp:(.text+0x9ef): undefined reference to `cvShowVecSamples(char const*, int, int, double)'
collect2: ld returned 1 exit status
#include "cvhaartraining.h"
int main( int argc, char* argv[] )
{
//some piece of code
}
Apparently, in that piece of code is to call a function from cvhaartraining.h. The problem is, it can't locate the header file. I compiled with this parameters.
g++ createsamples.cpp -o createsamples -L/home/daniel/Desktop/opencv/cvhaartraining
I even tried not including the -L option and copying the entire cvhaartraining.h inside the createsamples.cpp. Still an error occurs.
The Error:
/tmp/cczlgy9l.o: In function `main':
createsamples.cpp:(.text+0x8ad): undefined reference to `cvCreateTrainingSamples(char const*, char const*, int, int, char const*, int, int, int, double, double, double, int, int, int)'
createsamples.cpp:(.text+0x94e): undefined reference to `cvCreateTestSamples(char const*, char const*, int, int, char const*, int, int, int, double, double, double, int, int, int)'
createsamples.cpp:(.text+0x9a5): undefined reference to `cvCreateTrainingSamplesFromInfo(char const*, char const*, int, int, int, int)'
createsamples.cpp:(.text+0x9ef): undefined reference to `cvShowVecSamples(char const*, int, int, double)'
collect2: ld returned 1 exit status