Getting linker error from using tesseract library in visual studio - c++

#include <iostream>
#include <opencv2/opencv.hpp>
#include <string>
#include <tesseract/baseapi.h>
using namespace std;
using namespace cv;
int main() {
string text;
Mat im;
tesseract::TessBaseAPI* ocr = new tesseract::TessBaseAPI();
return 0;
}
This gives me the error unresolved external symbol in TessBaseAPI. My tesseract should be properly downloaded, in command prompt, "tesseract --version" says I'm using version 5.0, its added to my path. I also tried following this https://github.com/vtempest/tesseract-ocr-sample which didn't work and gave me the linker error.

Related

cannot find permission denied opencv/lib

I wrote a very simple program with opencv
and I get this problem ( I'm using TDM-GCC x64 compiler)
cannot find c:/opencv/opencv2/build/x64/lib permission denied
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "opencv2/opencv.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main (){
Mat image =imread("An0nymOu5.jpg");
namedWindow("image",cv::WINDOW_FREERATIO);
imshow("image",image);
waitKey(0);
}
Could be a compiler error; you can try in this link to find the toolchain
mingw-w64
Also assure the image file is near your program file.
try this aswell.
Mat image;
image = imread("An0nymOu5.jpg", CV_LOAD_IMAGE_COLOR);

How to link X11 to qt project on MacOS High Sierra

I try to compile Qt project using dlib
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/dnn.h>
#include <dlib/gui_widgets.h>
#include <dlib/clustering.h>
#include <dlib/string.h>
#include <dlib/image_io.h>
#include <iostream>
using namespace cv;
using namespace dlib;
using namespace std;
int main(int argc, char *argv[])
{
frontal_face_detector detector = get_frontal_face_detector();
matrix <rgb_pixel> image;
load_image(image, "/Users/ivanlebedev/Desktop/Projects/ManSearch/cars/2.jpg");
image_window win(image);
}
but i have this ERROR:
/usr/local/Cellar/dlib/19.15/include/dlib/gui_core/gui_core_kernel_2.h:12: ошибка: "Also make sure you have libx11-dev installed on your system"
#error "Also make sure you have libx11-dev installed on your system"
^
How i can make my program work?
You don't need nor want x11-anything. You need to compile dlib without x11 support, and then it'll work fine.

argp library cannot be found in eclipse

I created a new c++-project in Eclipse.
This is the code:
#include <argp.h>
#include <iostream>
using namespace std;
int main() {
// ...
return 0;
}
However I get the following compiler-error:
fatal error: argp.h: No such file or directory
Is argp.h part of the compiler? I´m using MinGW-GCC-toolchain in Eclipse.

OpenCV application fails to build when including highgui.hpp

Trying to make a hello-world style opencv program, but fails to compile if I don't include highgui.hpp, yet fails to link if I do include it.
For example, when I include that header, the linker complains:
undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&
#include <opencv2/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main(int argc, char *args[])
{
Mat &frame;
Mat grayscale;
CascadeClassifier &face_cascade;
vector<cv::Rect> &faces;
VideoCapture *capture;
...
If I don't include highgui.hpp, then it doesn't compile due to errors like:
'VideoCapture’ was not declared in this scope
I'm using pyimagesearch's vagrant based ubuntu virtual machine that comes with cv2 installed. The cv2 Python scripts work fine, but just not the c++

cygstdc++-6.dll Entry Point Not Found

I have the following code:
#include <string>
#include <iostream>
using namespace std;
int main()
{
string myString = "This is a string";
return 0;
}
When I compile it with g++ I get the following error:
The procedure entry point
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcRKS3_ could not be located in the dynamic link library cygstdc++-6.dll.
I've tried re-installing cygwin but that didn't fix anything, does anyone have any ideas?