Giter Site home page Giter Site logo

fbdtemme / bencode Goto Github PK

View Code? Open in Web Editor NEW
42.0 5.0 5.0 20.19 MB

A C++20 header-only bencode library.

License: MIT License

CMake 1.98% C++ 85.86% Jupyter Notebook 11.56% Python 0.35% Shell 0.25%
bencode bittorrent cpp20 serialization bencode-parser deserialization bencoder

bencode's Issues

compiler error

had to add T tmp; at

if (__builtin_mul_overflow(val, sign, &tmp)) {

[ 37%] Building CXX object _deps/yaml-cpp-build/CMakeFiles/yaml-cpp.dir/src/parser.cpp.o
In file included from /home/skydrome/torrenttools/build/_deps/bencode-src/include/bencode/detail/parser/from_chars.hpp:12,
                 from /home/skydrome/torrenttools/build/_deps/bencode-src/include/bencode/detail/bpointer.hpp:12,
                 from /home/skydrome/torrenttools/build/_deps/bencode-src/include/bencode/detail/bvalue/pointer.hpp:4,
                 from /home/skydrome/torrenttools/build/_deps/bencode-src/include/bencode/bvalue.hpp:12,
                 from /home/skydrome/torrenttools/build/_deps/bencode-src/include/bencode/bencode.hpp:3,
                 from /home/skydrome/torrenttools/build/_deps/dottorrent-src/include/dottorrent/announce_url.hpp:13,
                 from /home/skydrome/torrenttools/build/_deps/dottorrent-src/include/dottorrent/announce_url_list.hpp:4,
                 from /home/skydrome/torrenttools/build/_deps/dottorrent-src/src/announce_url_list.cpp:2:
/home/skydrome/torrenttools/build/_deps/bencode-src/include/bencode/detail/parser/implementation/from_chars_sse41.hpp: In function 'constexpr bencode::detail::from_chars_result bencode::detail::from_chars(const char*, const char*, T&, bencode::detail::implementation_tag<2>)':
/home/skydrome/torrenttools/build/_deps/bencode-src/include/bencode/detail/parser/implementation/from_chars_sse41.hpp:274:44: error: 'tmp' was not declared in this scope; did you mean 'tm'?
274 |     if (__builtin_mul_overflow(val, sign, &tmp)) {
    |                                            ^~~
    |                                            tm

1.0.1 not listed as release

Some probably nitpick and minor observations:

  • There is no entry for the 1.0.1 release on the releases page.
  • The 1.0.1 tag does not have the "v" prefix as previous releases/tags did.
  • The changelog mentions it with "v" prefix.
  • The changelog mentions a v1.0.0, which was never tagged or listed among the releases (this is probably fine).

How to generate the project files for this and build?

After I clone the repository and run cmake CMakeLists.txt, I get:

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19045.
-- The CXX compiler identification is MSVC 19.36.32537.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:30 (find_package):
  Could not find a package configuration file provided by "fmt" with any of
  the following names:

    fmtConfig.cmake
    fmt-config.cmake

  Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
  to a directory containing one of the above files.  If "fmt" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!

The fmt library doesn't have fmtConfig.cmake or fmt-config.cmake files anywhere in the repository.

Build errors with deps and instructions

  1. Your makefile is not fetching the 3 libs dependancies : fmt, gsl-lite, expected-lite
  • I had to compile and install them separatly for the build to find them.
  • CMake error type :
CMake Error at CMakeLists.txt (find_package):                                                                                                                     
  Could not find a package configuration file provided by "gsl-lite" with any                                                                                                                
  of the following names:                                                                                                                                                                    
                                                                                                                                                                                             
    gsl-liteConfig.cmake                                                                                                                                                                     
    gsl-lite-config.cmake                                                                                                                                                                    
                                                                                                                                                                                             
  Add the installation prefix of "gsl-lite" to CMAKE_PREFIX_PATH or set                                                                                                                      
  "gsl-lite_DIR" to a directory containing one of the above files.  If                                                                                                                       
  "gsl-lite" provides a separate development package or SDK, be sure it has                                                                                                                  
  been installed.
  1. Cmake don't like your instruction for a release build and it miss the build type.
  • Updated instruction :
git clone --depth=1 https://github.com/fbdtemme/bencode
cd bencode; mkdir build; cd build
cmake -DCMAKE_BUILD_TYPE=Release
      -DBENCODE_BUILD_TESTS=OFF \
      -DBENCODE_BUILD_BENCHMARKS=OFF \
      -DBENCODE_BUILD_DOCS=OFF \
      ..
sudo make install

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.