Getting Boost 1.68 working on Ubuntu 18.04 - c++

I want to use Boost 1.68 on Ubuntu 18.04. I noticed the Boost/libboost package available on Ubuntu is only 1.65, so I found a resource that suggested the following:
sudo apt-get remove libboost-all-dev
sudo add-apt-repository ppa:mhier/libboost-latest
sudo apt update
sudo apt install libboost1.68
However, after running this I no longer have the boost include files in my /usr/include directory. If I do sudo apt-get install libboost-all-dev, it seems I can only add 1.65.1
Is there a way I can get boost and the include files from 1.68 to run on Ubuntu 18.04?
I'm still relatively new to Linux/ubuntu so perhaps I'm overlooking something simple? Thanks for your assistance.

By installing libboost1.68 you only install Boost library files. Header files are at libboost1.68-dev:
sudo apt install libboost1.68-dev

Related

How can i download and install llvm on Ubuntu 18.04?

I have llvm-6.0 and i=I don't know how to download and install llvm-7.0 on Ubuntu 18.04? Can I install it from terminal or I download from a site?
There are basically two ways to install LLVM on your Ubuntu 18.04 machine:
Source
Binary
Considering your question, it seems you would like to have a binary version of LLVM. Therefore you can install LLVM from your Ubuntu 18.04 terminal as following:
First of all, you should update packages as following:
sudo apt-get update
However, for custom LLVM i.e. in your case LLVM 7:
sudo apt-get install -y llvm-7
sudo apt-get install -y llvm-7 llvm-7-dev llvm-7-tools clang-7
Do you want some LLVM-7 examples?
sudo apt-get -y install llvm-7-examples
Do you want to remove LLVM-6?
sudo apt-get purge llvm-6.0 clang-6.0
sudo add-apt-repository --remove ppa:kxstudio-team/builds
For default LLVM installation you should run following (not for your case):
sudo apt install llvm
For detail packages please check LLVM Ubuntu nightly packages
However, currently the last version of LLVM is LLVM 13.0. 1. It is better to install the latest version.

Is there easy way to include xlnt to Visual Studio Code on Ubuntu?

I want to use xlnt library to edit xlsx data but i don't know how to input this to global libraries of VSC. Could you please tell me step by step how install this library?
https://github.com/tfussell/xlnt
You need some packages firstly:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install cmake
sudo apt-get install zlibc
The following steps update the compiler and set the appropriate environment variables:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt-get upgrade
sudo apt-get install gcc-6 g++-6
export CC=/usr/bin/gcc-6
export CXX=/usr/bin/g++-6
The following steps will intall xlnt Download the zip file from the xlnt repository:
cd ~
unzip Downloads/xlnt-master.zip
cd xlnt-master
cmake .
make -j 2
sudo make install
The following step will map the shared library names to the location of the corresponding shared library files:
sudo ldconfig
xlnt will now be ready to use on your Ubuntu instance.
source

Debian Stretch and Jessie 32-bit libraries

For those looking for the answer, there it's, as it's not clear on other websites.
This is required at least by the Intel compiler. Maybe it helps also for other software.
Just run those commands in your terminal.
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential gcc-multilib rpm libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
Or as root remove the "sudo" from them.

How to fix gstreamer error in Qt5?

I want to create a small mp3 player as a toy project so started with Qt for the GUI. When I try to play an mp3 file i get this error.
Warning: "No decoder available for type 'audio/mpeg, mpegversion=(int)1,
mpegaudioversion=(int)1, layer=(int)3, rate=(int)44100, channels=(int)2,
parsed=(boolean)true'."
Error: "Your GStreamer installation is missing a plug-in."
I installed gstreamer and it's plugins after googling around
sudo apt-get install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
But I still get the error. How do I fix it?
I had the same problem.
After using below code it fixed.
sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-plugins-ugly
Qt Creator 3.4.2 Ubuntu 14.04
I tried digging a little into this and according to this thread in the Qt forums the issue seems to be that the QtMultimedia module is still using GStreamer 0.10 as a backend - and from that it needs the gstreamer-0.10-ffmpeg plugin which is not available in some distros anymore due to the move to libav.
If you're using a flavour of Ubuntu you can try installing gstreamer-0.10-ffmpeg from Doug McMahon's ppa:
sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
On Debian8, QT5.7, I'm executing this:
sudo apt-get install gstreamer1.0*
sudo apt-get install gstreamer0.10*
this is not the best way, but it works.
Regards.
On Ubuntu20.04, I solved this problem by:
sudo apt-get install gstreamer1.0-libav

Uninstall boost and install another version

I've installed the boost libraries on Linux Mint 12 using the command sudo apt-get install libboost-dev libboost-doc, which installs the default version available in the repositories. However, the project I have to do needs the 1.44 version of boost. How do I uninstall the default (current) version 1.46 and install 1.44?
I couldn't find the documentation on the boost website to install boost from the .tar.gz package.
Boost can installed by two ways
Deb package
wget and install manually
In some case we might have installed by both type which can cause version error. Lets see how to uninstall both.
sudo apt-get update
# to uninstall deb version
sudo apt-get -y --purge remove libboost-all-dev libboost-doc libboost-dev
# to uninstall the version which we installed from source
sudo rm -f /usr/lib/libboost_*
Then we need to install other dependencies if they are not met
sudo apt-get -y install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev
Lets download the boost version which we need from the link. I am downloading the 1.54 version. Then untar and install it.
# go to home folder
cd
wget http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
tar -zxvf boost_1_54_0.tar.gz
cd boost_1_54_0
# get the no of cpucores to make faster
cpuCores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | awk '{print $NF}'`
echo "Available CPU cores: "$cpuCores
./bootstrap.sh # this will generate ./b2
sudo ./b2 --with=all -j $cpuCores install
Now let's check the installed version
cat /usr/local/include/boost/version.hpp | grep "BOOST_LIB_VERSION"
You will see something like below
// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
#define BOOST_LIB_VERSION "1_54"
Version 1.54 of boost is installed
That's it, it worked for me. Let me know if you face any issues.
You can uninstall with
apt-get --purge remove libboost-dev libboost-doc
Download the package you need from boost website, extract and follow "getting started" instructions found inside index.html in the extracted directory.
Tested working Ubuntu 20.04 Use my script to uninstall your older version of boost in ubuntu 20.04 and follow rams instructions above
#!/bin/bash
sudo apt-get -y --purge remove libboost-all-dev libboost-doc libboost-dev
echo "clear boost dir"
sudo rm -r /usr/local/lib/libboost*
sudo rm -r /usr/local/include/boost
sudo rm -r /usr/local/lib/cmake/*
sudo rm -f /usr/lib/libboost_*
sudo rm -r /usr/include/boost
Downgrade your boost version. I'm not familiar with Mint, but assuming it is deb-based, you can do:
apt-cache show libboost-dev
to see all installable version and install a specific version with
sudo apt-get install libboost-dev=1.42.0.1
There are also convenience packages for the major boost versions:
sudo apt-get install libboost1.44-dev
As #savamane wrote you can uninstall it with
apt-get --purge remove libboost-dev libboost-doc
Another suggestion to install the .deb packages as suggested here. (Download the one fitted for your architecture though).
For still supported distros, you can simply search for the package at the distributions at http://packages.ubuntu.com/. For example libboost-system1.46.1 can be found in under the precise -> Libraries tab.
For unsupported distros, there is still a chance to find them at
http://archive.ubuntu.com/. For example can libboost-all-dev_1.40.0.1_amd64.deb be found in
http://archive.ubuntu.com/ubuntu/pool/universe/b/boost-defaults/.
This is how you install a specific Boost version:
cd boost_1_54_0/
./bootstrap.sh --with-libraries=atomic,date_time,exception,filesystem,iostreams,locale,program_options,regex,signals,system,test,thread,timer,log
sudo ./b2 install