missing .lib files while compiling qt 4.8 project - c++

I'm trying to build Open-Sankoré project (https://github.com/Sankore/Sankore-3.1) on qt-creator using qt 4.8.6 kit & mingw4 on windows..
I was able to overcome many compiler errors subsequently through some workarounds but this error stumped me:
g++: ole32.lib: No such file or directory
g++: oleaut32.lib: No such file or directory
g++: user32.lib: No such file or directory
g++: gdi32.lib: No such file or directory
g++: advapi32.lib: No such file or directory
I guess it's related to msvc compiler and that I'm compiling now using gcc..
Anyone have an idea how to fix this ??

g++ cannot use .lib generated by msvc, is use libXXX.a lib files
download Qt for mingw g++
http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-opensource-windows-x86-mingw482-4.8.7.exe

Related

How to compile tesseract baseapi.h with MinGW on window?

So I want to use tesseract api on my project.
And the problem is I don't know how to compile this baseapi.h with MinGW on window.
I'm using this
g++ -I/[...]/project/tesseract-master/include/ -I/[...]/project/leptonica/src/ t.cpp -o t
and got
In file included from t.cpp:2:
/[...]/project/tesseract-master/include/tesseract/baseapi.h:33:10: fatal error: tesseract/version.h: No such file or directory
#include <tesseract/version.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
I think the problem is about version.h file, It's actually a version.h.in file
leptonica also have same problem with .h.in file
I don't know if MinGW can compile this type of file, so if there's a way or it can't pls tell me thanks.
g++.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0
Tesseract from main branch https://github.com/tesseract-ocr/tesseract
Leptonica from 1.80.0 release
https://github.com/DanBloomberg/leptonica
It seems that you did not install tesseract - otherwise version.h (actually generated during tesseract build/compilation) would be present.

How to run a .cpp file with Gecode Framework on Linux?

I use Ubuntu 18.04 and try to compile the example 'money.cpp' file that Gecode brings. I downloaded (gecode-release-5.1.0.tar.gz) and extract it. Then to install Gecode I do the following steps:
(1) ./configure
(2) make
I get satisfactory installation.
Then I try to compile money.cpp, like this:
$g++ money.cpp
and I get the following error:
fatal error: gecode / driver.hh: No such file or directory
  #include
           ^ ~~~~~~~~~~~~~~~~~
I know the problem is that it does not recognize the libraries, but how can I make my .cpp or compile phase recognize them?
regards!
Alberto
You need to call g++ with the -I flag so that g++ knows where to look for the include files:
g++ -I<dir> money.cpp
<dir> is the source code directory for the files (the one with structure as seen on GitHub):
https://github.com/Gecode/gecode
See Compiling with g++:
https://courses.cs.washington.edu/courses/cse373/99au/unix/g++.html

Error message while compiling a program

I’m a newbie to C++ and Linux. There is this code I’m playing with that requires me to install the HElib (Homomorphic encryption library and other libraries - GMP, NTL) which I did. I want to compile the code (main.cpp) that has a header file (FHE.h) in HElib. My problem is how can I link FHE.h (in HElib folder) and main.cpp (in another folder) together so that I can compile them. I have tried some commands
g++ -I/Home/HElib/src/FHE.h main.cpp -o main
Error message
main.cpp:1:17: fatal error: FHE.h: No such file or directory
compilation terminated.
Another command line
g++ -I/Home/HElib/Src/FHE.h -I/Home/SimpleFHESum-master/SimpleFHESum-master/main.cpp -o main]
Error Message
g++: fatal error: no input files
compilation terminated.
What's wrong and how can I fix this?
The -I flag adds the following directory to the include path of the compiler. This enables you to write e.g. #include "FHE.h" even though that file is not located in the same folder as the source file you're trying to compile.
Have you tried just removing the 'FHE.h' part from your -I directive?
g++ -I/Home/HElib/src ...

"fatal error: boost/regex.hpp: No such file or directory" when trying to compile C++ program using a makefile

I am trying to compile a piece of open source software called "SPECIES
Identification of Taxonomic Mentions in Text". I am on MacOS.
I downloaded the source code (which can be found here), moved into the directory and used the command make to compile. This is the error returned:
g++ -fpic -pthread -Wall -O3 -o organisms organisms.cxx -lm -lboost_regex
In file included from batch_tagger.h:5:0,
from organisms.cxx:3:
tagger.h:7:27: fatal error: boost/regex.hpp: No such file or directory
compilation terminated.
make: *** [organisms] Error 1
I installed the C++ boost library using brew install boostand tried the above steps again (it did not work).
I tried dropping the boost directory into the directory containing the source code (it did not work).
Any suggestions/help?
You need to tell the compiler where to find boost headers.
You need to use the include path option to specify where the boost headers can be find, use -I/path/to/boost/include.
Then include the file using #include <boost/regex.hpp> from your code.

Compiling tesseract on Windows using Cygwin GCC

Getting below error while compiling tesseract source on Windows using Cygwin GCC:
-MT"training/commontraining.d" -o "training/commontraining.o" "../training/commontraining.cpp"
../training/commontraining.cpp:17:30: fatal error: base/init_google.h: No such file or directory
Please help me find which library provides the init_google.h header file.