How to add files to build "pocketsphinx" in codeblocks? - c++

I can compile the sample continuous.c file by this command inside Ubuntu terminal:
gcc -o continuous continuous.c -DMODELDIR=\"`pkg-config --variable=modeldir pocketsphinx`\" `pkg-config --cflags --libs pocketsphinx sphinxbase`
But if I want to build it inside codeblocks how should I do it?

Related

No package 'opencv' found

I'm trying out this github repository, one of the requirements is to have opencv 3.1
when I run pip list I have opencv-python and opencv-contrib-python both version 4.7.0.68
$ g++ -std=c++11 Heartbeat.cpp opencv.cpp RPPG.cpp `pkg-config --cflags --libs opencv` -o Heartbeat
but when I run the above I get the error below
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
Please use opencv4 instead of opencv. So your command will look like:
g++ -std=c++11 Heartbeat.cpp opencv.cpp RPPG.cpp `pkg-config --cflags --libs opencv4` -o Heartbeat
It should work.

How to develop libvirt C++ apps in Mac OS

I want to develop c++ apps that use libvirt api (libvirt/libvirt.h) in Mac OS. In Ubuntu once I installed libvirt-dev, it was compiling fine. but in mac I cannot find a way to install libvirt-dev. Can someone point me to the correct path. Thanks :D
If you install homebrew first, from the Homebrew website, then you will be able to simply install libvirt with:
brew install libvirt
If you want to compile against libvirt, I would further suggest you install pkgconfig with:
brew install pkgconfig
After that you can use pkgconfig to find the switches and flags you need for libvirt like this:
pkg-config --cflags --libs libvirt
which will give you something like:
-I/usr/local/Cellar/libvirt/3.4.0/include -L/usr/local/Cellar/libvirt/3.4.0/lib -lvirt
So, in conclusion, you will then be able to compile C code with:
gcc program.c $(pkg-config --cflags --libs libvirt) -o program
or
clang program.c $(pkg-config --cflags --libs libvirt) -o program
or C++ code with:
clang++ program.cpp $(pkg-config --cflags --libs libvirt) -o program

compiling c++ projects with dlib library on linux

I want to use dlib library for my c++ projects in linux. I have installed it successfully and able to compile and run the .cpp samples files given under the dlib. I have compiled the sample files through the
"g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 example_program_name.cpp" given in [http://dlib.net/compile.html][1]
but I am unable to use the same command to run .cpp files which are the outside dlib-18.18/examples directory
Can someone help me out with compiling c++ file (with dlib library usage) from any user directory in linux?
I came to know that we have to include the path of dlib installation folder while trying to compile it from any other user directory. So I tried the command
" g++ -O3 -I/home/praneeth/computervision/.. ../dlib/all/source.cpp -lpthread -lX11 project3_face.cpp -o project_face pkg-config --cflags opencv pkg-config --libs opencv"
but it gave me the result:
g++: error: ../dlib/all/source.cpp: No such file or directory
Note: dlib-18.18 folder is present in my /home/praneeth/computervision/
I don't know how correct is this but it got compiled when I ran the command like: g++ -O3 -I/home/praneeth/computervision/dlib-18.18 /home/praneeth/computervision/dlib-18.18/dlib/all/source.cpp -lpthread -lX11 project3_face.cpp -o project_face pkg-config --cflags opencv pkg-config --libs opencv any comments on this regarding why this works?
g++ -Wl,-V -std=c++11 -o3 -I/home/user/dlib-19.6 /home/user/dlib-19.6/dlib/all/source.cpp -lpthread -lX11 -o Test Test.cpp pkg-config opencv --cflags --libs

libxml++/libxml++.h: No such file or directory

I am using ubuntu 12.4 g++ i'm working on libxml++ library I have included this library in my program but I am getting an error saying
libxml++/libxml++.h: No such file or directory
i also tried compiling using g++ main.cc -o main pkg-config --cflags --libs libxml++-2.6 but it is not working. I have installed the latest libraries using sudo apt-get install libxml++.
While compiling for libxml we have to use these options. pkg-config --cflags --libs libxml++-2.6 this should be in single quotation mark / Backticks ("`", grave accents), .
So the command should be like this.
$ g++ main.cc -o program `pkg-config --cflags --libs libxml++-2.6`
or go through this once. http://developer.gnome.org/libxml++/stable/

How to compile mergevec.cpp on Windows?

I have been following this tutorial ( http://note.sonots.com/SciSoftware/haartraining.html ) to do some Haar training. I am currently stuck on merging the generate *.vec files. I am provided with this ( http://note.sonots.com/SciSoftware/haartraining/mergevec.cpp.html ) script and a description of how to build it for Linux, but for Linux only.
I have installed Cygwin, placed mergevec.cpp file into openCV_dir/apps/haartraining and tried to compile it with the following command:
$ g++ 'pkg-config --libs --cflags opencv' -I. -o mergevec mergevec.cpp cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp cvhaartraining.cpp
I recieve following error:
$ g++: error: pkg-config --libs --cflags opencv: No such file or directory
Could someone tell me how should I properly compile it for Windows?
Working on Windows 7, Cygwin x64, OpenCV 2.4.6
I was able to get mergevec.exe from here:
http://note.sonots.com/SciSoftware/haartraining/mergevec.cpp.html
It requires highgui100.dll and cxcore100.dll which I downloaded from:
http://www.dllme.com/