accessing cpprest2.10 resources

Asked by Chris

Hi Ubuntu support,

I am using Ubuntu Jammy:

-------------
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
------------------

I have successfully installed the package "cpprest2.10".

My intention is to use this package in a c++ file via the " #include <folder/include.h> " or " #include "folder/include.h" "directives.

When I run "apt-file search cpprest2.10" on the Ubuntu command line I get these 2 lines:

libcpprest2.10: /usr/share/doc/libcpprest2.10/changelog.Debian.gz
libcpprest2.10: /usr/share/doc/libcpprest2.10/copyright

This seems to indicate that the package is installed in the /usr/share/doc/libcpprest2.10 folder.

Do I need to unzip the .gz file to get access to the package's header files? If so, do I unzip into the folder: /usr/share/doc/libcpprest2.10/ ?? If not, how can I a) refer to the headers in the C++ code b) refer to the package headers and any objects when I compile with the g++ compiler??

When I refer to one libcpprest2.10 header file via either of these directives in my cpp file and try to compile with g++:

#include <cpprest/http_client.h>
#include "cpprest/http_client.h"

g++ reports : "fatal error: cpprest/http_client.h: No such file or directory"

Thanks for your patience - although I am experienced at C++ coding, I am new to unix and Ubuntu!

Best regards
Chris

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu cpprest Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Best Manfred Hampl (m-hampl) said :
#1

In Ubuntu the files for running an application and the files needed for developing something with that application (e.g. the header files) usually are separated into different packages that have to be installed separately. This is also the case here.

You need to run
apt install libcpprest-dev

If you also want the documentation files, then run
apt install libcpprest-doc

Revision history for this message
Chris (csroka) said :
#2

Thanks Manfred, problem solved!