CppServer icon indicating copy to clipboard operation
CppServer copied to clipboard

Building on Ubuntu 20.04 LTS

Open KaiPetzke opened this issue 5 years ago • 0 comments
trafficstars

When building the library on Ubuntu 20.04 LTS, I needed to install the following packages before the built went through:

  • doxygen
  • libbfd-dev (which actually installed Paket binutils-dev)
  • uuid-dev

Yes, binutils-dev and uuid-dev are listed as prerequistes in the main README.md. But I must admit, that I overread these at first. I recommend changing the lines:

* Linux (binutils-dev uuid-dev libssl-dev)
* OSX (openssl)

to:

* Linux specific:
  * binutils-dev
  * uuid-dev
  * libssl-dev
  * doxygen (for building the documentation)
* OSX specific:
  * openssl

During the build, I also got this warning/error:

-- Could NOT find LIBVLD (missing: LIBVLD_LIBRARY)

However, this did not stop the build from running through. Is LIBVLD no more necessary?

The pre-installed OpenSSL library was found during the built:

-- OpenSSL version: 1.1.1f /usr/include /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so

Nonetheless, during gil update during the install, OpenSSL was downloaded (precompiled for Windows?) as a module. The binaries compiled during the built use the system OpenSSL library, though. I am always a bit scared, if a library is present twice (once in the system, once in a local version), as this can lead to serious issues later, when one version of the library is used for compilation and the other version is used for linking. I removed OpenSSL from the modules directory and the compile still went through, though.

People, that also have the Boost C++ library installed, might want to use boost::asio instead of Standalone libasio. You could add that as a configuration option, too, or autodetect an installed and recent enough boost and then use its asio automatically. I believe, the major difference between standalone libasio and boost::asio is the path of the include files (for example asio.hpp become boost/asio.hpp) and the namespace (boost::asio vs. asio). It shouldn't be hard to adapt between the two via a few #ifdef's.

Unfortunately, the header files and libraries are not automatically installed into the typical system-wide directories /usr/local/include and /usr/local/lib. Furthermore, your libraries hold very generic names like time/time.h or utility/iostream.h, which are very near hits on system include files like <time.h>, <utility> or <iostream>. So that more people can base their work on your nice libraries, I strongly recommend, that you choose a unique path prefix like chronoxor.

Unfortunately, adding that prefix would make your includes in the CppServer projekt very long, like chronoxor/server/http/http_response.h. I believe, you could leave out the server subdirectory. That name is even misleading, as you also implement the client side! chronoxor/http/http_response.h is still unique and clear enough. You could even leave out the http_ prefix on the files in the http directory and the ws_ prefix on the files in the ws directory. chronoxor/http/client_ssl.h should be clear enough to everybody :-)

Thank you again for the good work :1st_place_medal:

KaiPetzke avatar Sep 17 '20 13:09 KaiPetzke