diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index 1102cba5ebc55..c603e3c35dff6 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -1,15 +1,17 @@ add_subdirectory(clock) add_subdirectory(custom_collection_adapter) add_subdirectory(dna) -add_subdirectory(shared_recording) add_subdirectory(minimal) +add_subdirectory(shared_recording) add_subdirectory(spawn_viewer) +add_subdirectory(stdio) add_custom_target(examples) add_dependencies(examples example_clock) add_dependencies(examples example_custom_collection_adapter) add_dependencies(examples example_dna) -add_dependencies(examples example_shared_recording) add_dependencies(examples example_minimal) +add_dependencies(examples example_shared_recording) add_dependencies(examples example_spawn_viewer) +add_dependencies(examples example_stdio) diff --git a/examples/cpp/stdio/README.md b/examples/cpp/stdio/README.md index 47f03cb3b8a3f..823c505c77405 100644 --- a/examples/cpp/stdio/README.md +++ b/examples/cpp/stdio/README.md @@ -18,6 +18,7 @@ Demonstrates how to log data to standard output with the Rerun SDK, and then vis To build it from a checkout of the repository (requires a Rust toolchain): ```bash -just cpp-build-examples -echo 'hello from stdin!' | ./build/debug/examples/cpp/stdio/example_stdio | rerun - +cmake . +cmake --build . --target example_stdio +echo 'hello from stdin!' | ./examples/cpp/stdio/example_stdio | rerun - ``` diff --git a/rerun_cpp/src/rerun/error.hpp b/rerun_cpp/src/rerun/error.hpp index 3623bf6915537..a1b71c01ef425 100644 --- a/rerun_cpp/src/rerun/error.hpp +++ b/rerun_cpp/src/rerun/error.hpp @@ -45,6 +45,7 @@ namespace rerun { _CategoryRecordingStream = 0x0000'0100, RecordingStreamCreationFailure, RecordingStreamSaveFailure, + RecordingStreamStdoutFailure, RecordingStreamSpawnFailure, // Arrow data processing errors. diff --git a/rerun_cpp/src/rerun/recording_stream.hpp b/rerun_cpp/src/rerun/recording_stream.hpp index 346309bb09dab..e3e063ade4d3f 100644 --- a/rerun_cpp/src/rerun/recording_stream.hpp +++ b/rerun_cpp/src/rerun/recording_stream.hpp @@ -182,6 +182,10 @@ namespace rerun { /// default back to `buffered` mode, in order not to break the user's terminal. /// /// This function returns immediately. + // + // NOTE: This should be called `stdout` like in other SDK, but turns out that `stdout` is a + // macro when compiling with msvc [1]. + // [1]: https://learn.microsoft.com/en-us/cpp/c-runtime-library/stdin-stdout-stderr?view=msvc-170 Error to_stdout() const; /// Initiates a flush the batching pipeline and waits for it to propagate.