flandmark library in dev c++ for feature point detection - c++

How to include flandmark library in dev c++? I need to find landmark points for eye.
There are no proper example for using flanmark in dev c++. When i included the header files in the project directory i still get linkage error.

it seems that there is still no official support for generating project for dev c++ in CMake. However, you can of course still use it. From your question it is not clear whether you have compiled flandmark library already and now want to create an external project in dev c++ using the library or if you want to compile flandmark library itself using dev c++.
If you have already successfully compiled flandmark and want to use it in external project, then besides setting the include directory and include the header files, you also need to specify linking directory and link flandmark libary to your project. See e.g. the CMakeLists.txt line 65 file for getting the idea what to include and what to link.
In case you want to use dev c++ for compiling the flandmark library, you need to link the OpenCV libraries and includes and specify the include directory with flandmark headers. For the OpenCV on linux works the command:
pkg-config --cflags --libs opencv
at the end of the g++ line.

Related

Can not make opencv3 run on Xcode with c++ macOs big sur

I am trying to set up an Xcode c++ project with opencv3, and I set up:
header search paths: /usr/local/Cellar/opencv#3/3.4.12_3/include
library search paths: /usr/local/Cellar/opencv#3/3.4.12_3/lib
other linker flags: the result from pkg-config --cflags --libs /usr/local/Cellar/opencv#3/3.4.12_3/lib/pkgconfig/opencv.pc
But when I import opencv in c++ code, it just doesn't find the opencv.hpp file. I imported it like this:
#include <opencv2/opencv.hpp>
And i can see it in the /usr/local/Cellar/opencv#3/3.4.12_3/include/opencv2 folder. I would appreciate any help..
If this is a not a library provided by the system (it's not I think), you should bundle it with your project by adding it to the Embedded Binaries section of your target's Build Phase. This way, your application, once compiled, will contain that library in its Frameworks folder.
If you don't do that, your compiled application won't run correctly because it will try to use a library that is not present on the computer of your user (so it will probably crash at runtime).
Finally the header search path will change accordingly and you should also ensure that this setting is correctly set :
LD_RUNPATH_SEARCH_PATHS = $(inherited) #executable_path/../Frameworks.

Linking to Tensorflow as an external lib to C++ application

Are there any supported alternatives to the approach presented on the Tensorflow C++ guide that instead allows you to separately build Tensorflow and link your C++ application to it as an external library?
I've managed to compile libtensorflow_cc.so and link to it. But where can I get valid header-files. Just grabbing the header-files from source gives errors and I have to manually adjust the paths, which I'd rather avoid.
I use this https://github.com/FloopCZ/tensorflow_cc repository and add find_package(TensorflowCC REQUIRED) in cmake and there is no issue with include file and not with lib target_link_libraries(project_name TensorflowCC::Shared)
or check that you include file path is correct to the path to you TF installation

How can Codeblocks find my header files even without adding any search paths

I'm learning to use OpenCV (and C++) in Codeblocks. What confuses me, however, is that when I start to include header files from OpenCV in my main.cpp file, Codeblocks automatically suggests to me the files as shown in the image below.
I have not included any search paths to project build options, so how is this possible that Codeblocks can find the files? Is there some other variable working here that I'm unaware of?
Note that I'm a beginner with both Codeblocks and OpenCV and that I only have a little experience with C++.
Thank you
Of course when you install an IDE like code::blocks by default, it knows about standard path for library on your OS.
On my OS -> Ubuntu that is /usr/include
It only searches on a standard path, except you add one. If you install your library by command-line, it goes to the standard place, if you installed manually, then it depends on your option you added to installation. I can not see you screen-shot but it has access to /usr/include by default.
For more detail on Linux and OpenCV
And here is a screen-shot of codeblock on Ubuntu that I added some 3rd-party library
NOTE:
if you install any libraries by command-line, just use it.
But if you have installed them manually, you need to add 2 things to codeblock.
1. First is your path for header file
2. Second is your path for linker
And you see it in screen-shot that say: Search Directory
First is for header and second is for linker

How to correctly include Dlib in Eclipse project?

I'm currently trying to use the Dlib c++ library in my own project. So I included the main folder of dlib to my project. I also added the dlib/all/source.cpp to my project. When I try to compile the code of the svm_c_ex.cpp example in my own test.cpp file, I only get:
fatal error: dlib/svm.h: No such file or directory
The section Dlib: How to compile didn't help me and I couldn't find further information online. Any help is appreciated!
You need to compile the DLib library first, using the instructions from the website.
cd examples
mkdir build
cd build
cmake ..
cmake --build . --config Release
cmake is a famous tool to build software on multiple platforms. It generates required files first and then you can compile the library using those generated files later.
You need to add the "include" directories (the folders where the headers exist) in your project configuration. I'm quite not sure of where exactly to add in Eclipse CDT.
After that, your program gives linker error because the the header files only contain skeletons of your library code. Actual implementation need to be linked with "linker options" in project properties. You need to add your library's .lib/.a files with your program. I don't exactly remember where is linker options in CDT (I'm talking in Visual Studio context)
Basically for any library you want to use in any C++ project:
You need to include HEADERS in your project properties
You need to link to actual implementation of the library. You can read about
static and dynamic libraries (Someone on SO must have given an
awesome explanation)

How do I link a library to my project in CodeBlocks & GCC without adding the library source to my project

I am writing a program that uses the hashlib++ library (or will use it) but I don't want to add all of it's source files to my project because it's huge. Is there anyway to link to the hashlib++ source files so that I can use it in my project? I've tried linking to the header directly with a simple
#include "path/to/hashlibpp.h"
But I receive a nifty error for it as soon as I attempt to call any functions from the library. For example:
undefined reference to `sha1wrapper::sha1wrapper()
I am using the Code::Blocks IDE and GCC compiler.
First you have to have the library installed on your machine, already compiled into a static or dynamic library file. You can install from source, or you may find a pre-built package available for your OS (depending on which OS you are using). You will need to know the name of the library.
In the case of hashlib++ they have provided instructions to build a static library from source in their README; see section 3.2.
In most cases, dynamic linking is the best choice. This means that the library is linked with the library at run time, instead of adding the library to your executable when it is compiled (which would make your executable file much larger).
Unfortunately, according to their README.txt, hashlib is only available as a static lib, which limits your choices.
When compiling a program on the command line using gcc, the '-l' option links in a library:
gcc -o MyProg -lhl++ MyProg.c
When using an IDE like Code::Blocks, you normally have to specify the libraries to be linked. See this answer for details on how to do this with Code::Blocks.