Skip to content

boost v1.71 - Program fails to compile after including header : <boost/process.hpp> #96

Closed

Description

@m7b

I dont't know if it is relatet to #92, but i can't compile the same source code with only the header included with boost 1.71.

In file included from W:/boost_1_71_0/boost/process/detail/windows/handles.hpp:11,
                 from W:/boost_1_71_0/boost/process/detail/used_handles.hpp:17,
                 from W:/boost_1_71_0/boost/process/detail/windows/async_in.hpp:20,
                 from W:/boost_1_71_0/boost/process/async.hpp:49,
                 from W:/boost_1_71_0/boost/process.hpp:23,
                 from X:\trunk\test\test_boost_process.cpp:1:
W:/boost_1_71_0/boost/process/detail/windows/handle_workaround.hpp:209:51: error: expected ')' before '*' token
 typedef ::boost::winapi::NTSTATUS_ (__kernel_entry *nt_system_query_information_p )(
                                    ~              ^~
                                                   )
W:/boost_1_71_0/boost/process/detail/windows/handle_workaround.hpp:224:51: error: expected ')' before '*' token
 typedef ::boost::winapi::NTSTATUS_ (__kernel_entry *nt_query_object_p )(
                                    ~              ^~
                                                   )
W:/boost_1_71_0/boost/process/detail/windows/handle_workaround.hpp: In function 'boost::winapi::NTSTATUS_ boost::process
::detail::windows::workaround::nt_system_query_information(boost::process::detail::windows::workaround::SYSTEM_INFORMATI
ON_CLASS_, void*, boost::winapi::ULONG_, boost::winapi::PULONG_)':
W:/boost_1_71_0/boost/process/detail/windows/handle_workaround.hpp:240:12: error: 'nt_system_query_information_p' does n
ot name a type; did you mean 'nt_system_query_information'?
     static nt_system_query_information_p f = reinterpret_cast<nt_system_query_information_p>(::boost::winapi::get_proc_
address(h, "NtQuerySystemInformation"));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            nt_system_query_information
...

Activity

  1. sinkingsugar commented on Oct 16, 2019

    @sinkingsugar
  2. gibbontrothy commented on Apr 2, 2020

    @gibbontrothy

    It also works if you define:

    -DBOOST_USE_WINDOWS_H -DWIN32_LEAN_AND_MEAN
    

    So I just added this to my CMakeLists.txt file:

    # Boost.Process 1.71+ fails without windows.h.
    # WIN32_LEAN_AND_MEAN avoids issues with asio.
    # https://github.com/boostorg/process/issues/96
    if(Boost_VERSION GREATER 107000)
      add_definitions(-DBOOST_USE_WINDOWS_H -DWIN32_LEAN_AND_MEAN)
    endif()
  3. Gei0r commented on Apr 25, 2020

    @Gei0r

    It also works if you define:

    -DBOOST_USE_WINDOWS_H -DWIN32_LEAN_AND_MEAN
    

    I also had to #include <windows.h> myself.

  4. klemens-morgenstern commented on Apr 27, 2020

    @klemens-morgenstern
    Collaborator

    Are all you guys using mingw? And does mingw work with boost.dll?

  5. Gei0r commented on May 5, 2020

    @Gei0r

    Yeah, I'm using mingw64 installed through MSYS2.
    Haven't tried boost.dll.

  6. gibbontrothy commented on Jun 1, 2020

    @gibbontrothy

    I'm also using msys2/mingw64. I'm not sure what boost.dll means for msys2, but I do use static and dynamic linking.

  7. added a commit that references this issue on Jul 1, 2021
  8. added a commit that references this issue on Jul 1, 2021
  9. 3 remaining items

  10. added 4 commits that reference this issue on Oct 16, 2025
  11. added a commit that references this issue on Jun 28, 2026
  12. added a commit that references this issue on Jun 30, 2026
  13. added a commit that references this issue on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions