0

I am using jni and want to read file from path, i used:

while (std::getline(file, str)) {
...

}

but it get an error : Function 'getline' could not be resolved, i have added:

#include <vector>
#include <string.h>
#include <jni.h>
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <iostream>

and they are Ok. How do i resolved this problem? Please help me.

1 Answers1

1

use:

#include <string>

instead of:

#include <string.h>

The latter one is the C variant and will not have the std namespace. Also see:

Difference between <string> and <string.h>?

Community
  • 1
  • 1
Martijn Wijns
  • 501
  • 7
  • 19