how to install mcrypt and add mcrypt.h to my C program files? - c

I need to work on trying to get AES encryption/decryption on some examples and have to use mcrypt.h in my C files. However, I do not know how to install them. I have downloaded and unzipped mcrypt-2.6.7-win32 which from https://sourceforge.net/projects/mcrypt/
I can't seem to figure out how to continue and "install" this header. Please advice.

You just need add those files to your project, add #include mcrypt.h to source which uses mcrypt, and add mcrypt.a to be linked together with your code.

Related

openGL with glew - file missing

I tried getting this repository to work.
And here is the problem: I saw that the demo program included GLEW as a static library (not sure about that - the source code of GLEW is included. Is that a library then? I don't know) and I thought because I'm on Ubuntu (20.04) that could be done easier. So I used the sudo apt-get install libglew-dev to install all needed header files and so on. Easy! But then there came a part in the demo where the header file eglew.h was used and gcc could not find that. I looked into /usr/include/GL and this header file was really missing. I tried installing a bunch of other packages. No success.
Does someone out there know how I get the package with this header file? Or is there no other way around than to do it like in the demo with a CmakeList?
You should be able to find the missing header file from here which is the official site: http://glew.sourceforge.net/
If not, you can defiantly find the missing header here:
https://chromium.googlesource.com/external/github.com/google/quic-trace/+/refs/heads/master/third_party/glew/include/GL

sphinxclient.h header is not found on debian

I'm trying to use the C client library of http://sphinxsearch.com in my project. It compiles fine on ubuntu using libsphinxclient-dev package
However when I try to compile it on debian sid, it complains that the header sphinxclient.h is missing, and I can't find any package providing this header.
Is there any "clean" way to solve this problem ?
Seems libsphinxclient is not included in Debian upstream and there isn't a separate package.
You can grab the deb packages from Sphinx website,libsphinxclient is installed in /usr/share/sphinxsearch/api/libsphinxclient (you might need to copy the header to include folder or add this folder to path).

cmake install multiple version of the same library

I am trying to have a scheme with my library that is coherent and usable/reusable.
I work in a team where we work with continuous integration but sometimes I need to use old version of the same library. That's because some part of the software are not updated for using the new version.
I'm actually in the middle of a headache understanding how to use cmake for having something like this:
PATH/Library/Processor/Library_X/Version/static_library_and_includes
Where Library is a common name where to put my stuff
Processor could be attiny24, atmega, lxpXXXX, etc
Library_X is the name of the library
Version a progressive number from 0 to X
static_library_and_includes the static libraries built within that cmake module and the include files needed for using it.
How can I do this using cmake?
I work with different microprocessor crosscompiling with gcc. This is not a problem.
I work with static library, this is not a problem.
I can install them in the right directory. Not a problem
I can't ask the executable to link to the right .a file. Sometimes cmake pick the right one, sometimes not.
Can you please give me a hint on how you guys do it?
thank in advance
Andrea
See the search paths here: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure .
CMake will find packages in directories named name*, so you can install to <prefix>/FizzBuzz-1.0.0 and <prefix>/FizzBuzz-2.0.0.
As long as each as a correct ConfigVersion.cmake file, it should do what you want.

including wpa_ctrl.h in a C code

I would like to add wpa_ctrl.h on a C code, and the source code has the following header files:
#include "includes.h"
#include "common.h"
how do I suppose to have them? Do I need to install any package or do they suppose to be at the kernel header files or in the include path? If I need to include it manually, then each file depends on some many header files that needs to be added manually, is there a convenient way to add the files that are needed
These files are part of the hostapd project, and internal header files that won't be installed so you can't just include them after installing the package.
You'd be probably better off just ripping out the parts from wpa_ctrl.h you need. Depending on what you need it might be even better to use e.g. the DBus interface to communicate with wpa_supplicant (if that's what you want).
You get them from wpa_supplicant source code.
Here's where to find them:
wpa_supplicant-2.4/src/utils/includes.h
wpa_supplicant-2.4/src/utils/common.h
I copied them into my project directory and everything worked.
Here's where to find the source code:
https://w1.fi/releases/

Making libcurl CodeLite Project

I have downloaded Curl and would like to add libcurl only (no other stuffs) to my CodeLite Workspace. I have seen VC Project files but I do not use VC (and I use Primarily Ubuntu).
So I need help to know which files to Include and any pre-processor that I need to include for the library to compile.
I have tried adding all *.c/*.h files but I keep getting errors (if those errors can be of help I will post them). Add the include folder in curl root directory does not help either.
Thanks
I ended up with compiling library with terminal and just tell CL to find it there!

Resources