I'm having trouble using tesseract.
I've downloaded the source code and compiled successfully.
Then I created a project in VC++ and I'm trying to do the first steps.
I created a simple program and included
#include <baseapi.h>
On project properties -> Linker -> Additional Dependencies i`ve put all the libs that tesseract generated
ccmain.lib ccstruct.lib ccutil.lib classify.lib cube.lib cutil.lib dict.lib image.lib libtesseract_tessopt.lib libtesseract_training.lib neural_networks.lib textord.lib viewer.lib wordrec.lib
I also set the path of libs on Additional Libraries Directories. It seems to recognize the libs. But the problem is that i`m getting the following error:
fatal error C1083: Cannot open include file: 'baseapi.h': No such file or directory
Can anyone help me? I`m just starting and it is difficult.
As an update, I've set the paths and included the files on my solution. But I'm getting different errors on ccutil.h.
*fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory *
Due to this code
#ifdef WIN32
#include <windows.h>
#else
#include <pthread.h>
#include <semaphore.h>
#endif
On your project you need to add the path to the tesseract headers in "Additional Include Directories".
Related
I try to compile a cpp file with this header:
#include <stdlib.h>
#include <gtk/gtk.h>
I work with MSYS2, so both the compiler and the gtk library are installed through it. The cpp compiler path is:
D:\msys\usr\bin\cpp.exe
and here is the VS code include path additions, which I supplied to the IntelliSense Configurations page under "include path":
D:\msys\mingw64\include\gtk-2.0\**
D:\msys\mingw64\include\**
D:\msys\mingw64\lib\**
D:\msys\usr\include\**
and I have gtk etc. in the include folder. I actually installed three different versions of gtk, 2-4.
Before I added them to the include path, I got an error like "cannot open source file", and after adding them I get the
fatal error: gtk/gtk.h: No such file or directory
error. gtk/gtk.h is located just inside gtk-2.0. What am I doing wrong?
Thanks a lot.
I'm setting up a c++ visual studio project to use ImageMagick's api, Magick++, for image processing. However, when I try to include <Magick++.h> in the only cpp file in the whole solution/project, I encounter this error:
fatal error C1083: Cannot open include file: 'Magick++.h': No such file or directory
I tried right-clicking Magick++.h in my code and pressing open document <Magick++.h>. This lead to an error message, which says the file is not found in current source file's directory or in build system paths. However, in the error message, the Build System Path clearly says the path to the include directory.
I have:
added the include directory of ImageMagick-7.0.9-Q16 in the project's properties->C/C++
->Additional Include Directories.
added the lib directory of ImageMagick-7.0.9-Q16 in the project's properties->Linker->Additional Library Directories
added CORE_RL_Magick++_.lib, CORE_RL_MagickCore_.lib, and CORE_RL_MagickWand_.lib in the project's properties->Linker->Additional Dependencies
Made sure everything is x64
Set the configuration to release
I somehow made Magick+++_demo project, the one that comes with magick++, work after tinkering with the settings. However, I cannot make other projects/solutions work. I have checked the settings of the demo project and tried to replicate it in my project where appropriate, but I cannot make my own project work.
this is the only code:
#include "pch.h"
#include <Magick++.h>
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
}
I have been googling and trying to make this work for the last 6 hours. Any help is hugely appreciated.
I am attempting to statically link GLEW to Visual Studio 2017. I followed a video tutorial exactly, but I still got an error:
fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
I have no idea what could be causing it. Here are the steps I took to link GLEW:
Put the folder named GLEW into a folder called dependencies in the solution directory
Went to C/C++, General and under "Additional Include Directories," I added $(SolutionDir)Dependencies\GLEW\include, which, when I go to edit, evaluates to the correct path
Went to Linker, General and under "Additional Library Directories," I added $(SolutionDir)Dependencies\GLEW\lib\Release\Win32, which also evaluates to the correct path
Went to Linker, Input and under "Additional Dependencies," I added glew32s.lib
Finally, I went to C/C++, Preprocessor and under "Preprocessor Definitions," I added GLEW_STATIC
I also did this same process with GLFW, and it worked perfectly, so I have no idea what the problem could be. I have checked and doublechecked the paths, so I am fairly certain that they are correct. Thank you in advance!
Sounds like you're doing
#include <GL/glew.h>
When you should be doing
#include <glew.h>
Is glew.h directly in the win32 folder? Or is there a further "GL" folder?
I am creating a Visual C++ sample project where i need to include a third party library.
I added the lib and added the include directory.
But my problem is now, that the header files of the library have the following line in their header files:
#include <QtCore/QVector>
and the compiler error is:
error C1083: Cannot open include file: 'QtCore/QVector': No such file or directory
I have the used dlls, but I am stuck how to include them?!
I solved it with installing Qt locally and adding it to the PATH.
I started with learning C++ a few days ago and I would like to get some data to make it more funny. I found a powerful C++ library called Unirest that can help me to get data from many APIs and after practice the basics :)
I don't know how to include libraries into my project. I fond some videos about how to do it so I just created libs folder (like i always do when I'm programming in PHP) and I copied library files. After I included header file UNIRest.h into my source and added the libs directory into VS+ Directories option in Project Properties - Configuration Properties - VC+ Directories. Everything is still OK. But when I opened the header file UNIRest.h the problem appeared:
#import "UNIHTTPRequest.h"
#import "UNIHTTPRequestWithBody.h"
#import "HttpRequest/UNISimpleRequest.h"
#import "HttpRequest/UNIBodyRequest.h"
#import "HttpResponse/UNIHTTPBinaryResponse.h"
#import "HttpResponse/UNIHTTPJsonResponse.h"
#import "HttpResponse/UNIHTTPStringResponse.h"
All of those macros are underlined and compilation failed with message:
fatal error C1083: Cannot open type library file: 'libs\unirest\unihttprequest.h': Error loading type library/DLL.
Could you please help me? Hope it's not just a stupid question because I tried to make it works whole afternoon :(
Typically you need to do 5 things to include a library in your project:
1) Add #include statements necessary files with declarations/interfaces, e.g.:
#include "library.h"
2) Add an include directory for the compiler to look into
-> Configuration Properties/VC++ Directories/Include Directories (click and edit, add a new entry)
3) Add a library directory for *.lib files:
-> project(on top bar)/properties/Configuration Properties/VC++ Directories/Library Directories (click and edit, add a new entry)
4) Link the lib's *.lib files
-> Configuration Properties/Linker/Input/Additional Dependencies (e.g.: library.lib;
5) Place *.dll files either:
-> in the directory you'll be opening your final executable from or into Windows/system32
In code level also, you could add your lib to the project using the compiler directives #pragma.
example:
#pragma comment( lib, "yourLibrary.lib" )