Coder Social home page Coder Social logo

advanced-cpp-programming-cookbook's Introduction

Advanced-C-CookBook.

Advanced C++ CookBook, published by Packt

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781838559915

advanced-cpp-programming-cookbook's People

Contributors

packt-itservice avatar packtutkarshr avatar rianquinn avatar romydias avatar tikshas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advanced-cpp-programming-cookbook's Issues

Chapter05 Recipe04 testing thread-safe in main function

In main function, the "s.push(4)..." would make more sense if it is replaced by "std::thread t1( [&]{ s.push(4) };); t1.join()", all the way to "std::thread t6( [&]{ s.push(42) };); t6.join()", since we might use multi-threaded execution to test if a class is thread-safe.

Chapter06 recipe01_example01 hayai does not install properly on my ubuntu 20.04 focal fossa

Hello, so I follow the instructions on the book, p.182 but it turns out, on my machine running ubuntu 20.04 at least, that make cannot create the executable for recipe01_example01:

/home/.../Chapter06/recipe01.cpp:27:10: fatal error: hayai.hpp: No such file or directory 27
      | #include <hayai.hpp>
      |          ^~~~~~~~~~~
compilation terminated.

Seen that, I tried to download hayai from the author's repository, but with no success as the ppa itself is outdated:

  404  Not Found [IP: 185.125.190.52 80]
...
Reading package lists... Done`
                                              
E: The repository 'http://ppa.launchpad.net/bruun/hayai/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

As last resort, I then tried to copy the hayai.hpp file and its other header dependencies from the github repo directly into my chapter06 folder...to no avail, as compilation yields many errors, probably due to the fact that the .hpp files on github are tailored on a token example.

cmake gives errors: No download info given for 'chapter13' and its source directory

I tried to build examples as per instruction:

> mkdir build && cd build
> cmake ..
> make recipe01_examples

But got above errors.

In the repository the directories starts with capital letter: Chapter01, ... while in CMakeLists.txt it was used with small letter:

add_chapter(chapter01)
...

Then I tried to change all entries in CMakeLists.txt:

add_chapter(Chapter01)
...

then command

cmake ..

works ok, but make is not working:

 make recipe01_examples

Chapter07: new version 3 of the Catch2 library breaks recipe01 tests

As things stand right now cloning Catch2 git repo fails.
Version 3 of Catch2 can be downloaded by modifying the CMakeLists.txt of Chapter07 at lines 46-61 as follows:

add_custom_target(recipe01_examples)

list(APPEND CATCH_CMAKE_ARGS
    -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/
)

ExternalProject_Add(
    catch
    GIT_REPOSITORY https://github.com/catchorg/Catch2.git
    GIT_TAG origin/devel
    GIT_SHALLOW 1
    CMAKE_ARGS ${CATCH_CMAKE_ARGS}
    UPDATE_COMMAND cmake -E echo "-- Skipping update"
)

include_directories(${CMAKE_BINARY_DIR}/external/include)

recipe01.cpp has then to be modified so to accommodate the new multi-header approach of Catch2 v3, with its multiple updates of function names and namespaces.

A far better approach to solve this would consist in downloading Catch2 v2 from here, to place it in the ./Chapter07/build folder, and to modify #include <catch.hpp> to #include "catch.hpp" everywhere inside recipe01.cpp.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.