Answer the question
In order to leave comments, you need to log in
What to do with an undefined reference to error when passing a parameter to a function?
There is Qt_5_3_MinGW_32bit, Windiws 7 64bit.
I'm working in a graphical QT application.
The header (mainwindow.h) declares the following:
private:
QString image_path;
void separateImage(char* path_to_image);
QByteArray ba = image_path.toUtf8(); //image_path - путь до картинки
char *str;
str = ba.data();
separateImage(str); //тут компилятор говорит на ошибку
void separateImage(char* path_to_image)
{
Mat src;
Mat src_gray;
int thresh = 100;
int max_thresh = 255;
string path;
path.assign(path_to_image, strlen(path_to_image));
//string bufstr = path_to_image->toStdString();
// qDebug("dddd %d",bufstr);
src = cv::imread(path, 1);
cvtColor(src, src_gray, CV_BGR2GRAY);
}
Answer the question
In order to leave comments, you need to log in
The separate_image part of the code looks like this:void separateImage(char* path_to_image) { ... }
void MainWindow::separateImage(char* path_to_image)
{
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question