In Debian CMake cant find 'libmosquitto' - c

Im trying of compile a cmake project of C code in a Raspberry Pi with Debian 10, the CMakeList.txt search for package first, when ask for 'libmosquitto' show the error:
Checking for module 'libmosquitto'
No package 'libmosquitto' found.
Already have installed this package with the command:
sudo apt-get install libmosquitto-dev
Before this, the CMake show another error for the package json-c, but after install it with apt-get install, the problem gone, but now for this library the CMake not recognize mosquitto.

locate libmosquitto.pc
and then add this path to PKG_CONFIG_PATH
export PKG_CONFIG_PATH="Actual_Path to libmosquitto.pc"
This worked for me.

Related

Missing qt module script on (K)ubuntu 19.04

Since an updates I'm not able to compile my Qt code for my Desktop environment. Qmake tells me
Project ERROR: Unknown module(s) in QT: script
Does anyone know, which package I need to install on Ubuntu 19.04 to enable the script module for Qt?
I had the same issue in Ubuntu 18.04, Qt 5.
It can be solved by installing the qtscript5-dev package:
sudo apt-get install qtscript5-dev

How to link OpenSSL in CLion

I'm currently working on a web server in C and I wanted to include for hashing passwords. My problem right now is that I get the error undefined reference to 'SHA1' when trying to compile. It appears to be an error with the Linker because the building seemed to work fine.
This is how I call SHA1():
SHA1(src, srcLength, hashStr);
I've simply installed OpenSSL by using apt-get install openssl
Do I somehow have to add OpenSSL to the target_link_libraries in the CMake-File?
EDIT: Sorry, I miss-typed, I installed openssl-dev, not just openssl
You need to install the development package sudo apt-get install libssl-dev which includes the necessary header files.

Installing glibtop on ubuntu

I'm new to ubuntu and i'm currently using it on windows 7 with vmware workstation.
I need to access the CPU usage with a C program on terminal, so i thought of using glibtop_get_cpu() function on glibtop library. I just wrote #include <glibtop.h> in my code and compiled it with "gcc" on terminal, and it said
fatal error: glibtop.h: No such file or directory
compilation terminated.
I tried to install the library using this:
sudo apt-get install liblib2.0-dev
but the terminal said:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libglib2.0-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
libglib2.0-0 libglib2.0-bin
E: Package 'libglib2.0-dev' has no installation candidate
any ideas about this?
You should install libgtop2-dev (sudo apt-get install libgtop2-dev).

How to install cjson properly in Ubuntu 14.0LTS?

I am new in json and I don't know how to use but I found compare to XML json is better so, I am learning json in C programming in Ubuntu 14.0LTS.
I followed https://linuxprograms.wordpress.com/2010/05/20/install-json-c-in-linux/.
In this link, I installed libjson0 with the help of first command but when I installed libjson – debug symbols package with the help of second command which is mentioned in link then showing "E: Unable to locate package libjson0-dbg".
Also I gone through https://github.com/json-c/json-c. After cloning moved to json-c directory, in json-c directory I did sh autogen.sh then showing "autogen.sh: 2: autogen.sh: autoreconf: not found".
Why autoreconf is not works ? When I installed CppUTest and other stuffs then it works.
I also install build-essential which found in google for above problems but it can't works for me.
How can I installed cjson in a proper manner and how to use with the C-programms.
Try below commands:
$ sudo apt-get install libjson-glib-1.0-0 libjson-glib-1.0-0-dev
If you want to debug your programs and see the various steps of serializing/deserializing you can also install the libjson-glib – debug symbols package
$ sudo apt-get install libjson-glib-1.0-0-dbg
For documentation related to json-glib, you must install the following package
$ sudo apt-get install libjson-glib-1.0-0-doc
This documentation will then be available in file:///usr/share/gtk-doc/html/json-glib/index.html
Maybe your problem is related with the path.
The library is installed correctlly but you have tot tell the system where. Here a post on how to do it in Ubuntu How to set the environmental variable LD_LIBRARY_PATH in linux

opencv install folder on ubuntu

I installed opencv2.3 on ubuntu by first adding the ppa and the doing apt-get install
$ sudo add-apt-repository ppa:gijzelaar/cuda
$ sudo add-apt-repository ppa:gijzelaar/opencv2.3
$ sudo apt-get update
$ sudo apt-get install libopencv-dev
I am developing on Eclipse and my programs work. I have this one problem though, while following an ebook. I cannot find the /opencv/samples folder in my system. I did a unix directory search to no avail.
Also, in Synaptic Package Manager I find that the opencv packages are not marked green, ie they're not installed. However I have written and executed opencv codes on my machine.
What is the reason for this?
It seems you have installed binary OpenCV package while the samples are (most likely) included only to source package.

Resources