Fix compilation of foo.h: include <string> #19

pull vasild wants to merge 1 commits into bitcoin-core:master from vasild:fix-compilation-include-string changing 1 files +1 −0
  1. vasild commented at 4:22 PM on January 17, 2020: contributor

    std::string is used inside foo.h but it forgot to include the corresponding header:

    [ 53%] Building CXX object CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o
    /usr/bin/c++   -I/usr/local/lib/cmake/CapnProto/../../../include -IBUILD/libmultiprocess/include -ISOURCE/libmultiprocess/include -ISOURCE/libmultiprocess/src -IBUILD/libmultiprocess/src -isystem /usr/local/include -D_THREAD_SAFE -pthread -std=gnu++14 -o CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o -c BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++
    In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++:3:
    In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-types.h:6:
    In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy.h:7:
    SOURCE/libmultiprocess/src/mp/test/foo.h:17:17: error: implicit
          instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>,
          std::__1::allocator<char> >'
        std::string name;
                    ^
    /usr/include/c++/v1/iosfwd:210:32: note: template is declared here
        class _LIBCPP_TEMPLATE_VIS basic_string;
                                   ^
    1 error generated.
    ...
    
    $ c++ --version
    FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
    Target: x86_64-unknown-freebsd12.1
    Thread model: posix
    InstalledDir: /usr/bin
    
  2. Fix compilation of foo.h: include <string>
    std::string is used inside foo.h but it forgot to include the
    corresponding header:
    
    ```
    [ 53%] Building CXX object CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o
    /usr/bin/c++   -I/usr/local/lib/cmake/CapnProto/../../../include -IBUILD/libmultiprocess/include -ISOURCE/libmultiprocess/include -ISOURCE/libmultiprocess/src -IBUILD/libmultiprocess/src -isystem /usr/local/include -D_THREAD_SAFE -pthread -std=gnu++14 -o CMakeFiles/mptest.dir/src/mp/test/foo.capnp.proxy-server.c++.o -c BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++
    In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-server.c++:3:
    In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy-types.h:6:
    In file included from BUILD/libmultiprocess/src/mp/test/foo.capnp.proxy.h:7:
    SOURCE/libmultiprocess/src/mp/test/foo.h:17:17: error: implicit
          instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>,
          std::__1::allocator<char> >'
        std::string name;
                    ^
    /usr/include/c++/v1/iosfwd:210:32: note: template is declared here
        class _LIBCPP_TEMPLATE_VIS basic_string;
                                   ^
    1 error generated.
    ...
    
    $ c++ --version
    FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
    Target: x86_64-unknown-freebsd12.1
    Thread model: posix
    InstalledDir: /usr/bin
    ```
    c92112a786
  3. ryanofsky commented at 5:48 PM on January 17, 2020: collaborator

    Code review ACK c92112a786f47782aba1a512b667bed5e0788ee5.

    Good catch, a missing include also caused some problems for me in https://github.com/chaincodelabs/libmultiprocess/pull/16#issuecomment-571308678. A long time ago I had IWYU working on this code. I should probably get that working again to avoid more bugs like these.

  4. ryanofsky referenced this in commit fe76b287f7 on Jan 17, 2020
  5. ryanofsky merged this on Jan 17, 2020
  6. ryanofsky closed this on Jan 17, 2020

  7. vasild deleted the branch on Jan 17, 2020
  8. vasild commented at 7:56 PM on January 17, 2020: contributor

    A long time ago I had IWYU working on this code. I should probably get that working again to avoid more bugs like these.

    https://github.com/chaincodelabs/libmultiprocess/issues/20 Integrate iwyu so that it does not get forgotten.

  9. bitcoin-core locked this on Jun 25, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 10:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me