yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

release 0.8.0 fails to build on linux

Open ImOnALampshade opened this issue 8 months ago • 2 comments

Importing yaml-cpp via vcpkg is broken due to this.

When trying to build locally, the following error occurs:

FAILED: CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o 
/usr/bin/c++ -DYAML_CPP_STATIC_DEFINE -I/home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/include -I/home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/src -fPIC -g -std=gnu++11 -fPIC -Wall -Wextra -Wshadow -Weffc++ -Wno-long-long -pedantic -pedantic-errors -MD -MT CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o -MF CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o.d -o CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o -c /home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/src/emitterutils.cpp
/home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/src/emitterutils.cpp:221:11: error: ‘uint16_t’ was not declared in this scope
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |           ^~~~~~~~
/home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/src/emitterutils.cpp:13:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   12 | #include "yaml-cpp/null.h"
  +++ |+#include <cstdint>
   13 | #include "yaml-cpp/ostream_wrapper.h"
/home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/src/emitterutils.cpp:221:21: error: ‘uint16_t’ was not declared in this scope
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |                     ^~~~~~~~
/home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/src/emitterutils.cpp:221:21: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
/home/faith/.local/share/vcpkg/buildtrees/yaml-cpp/src/0.8.0-eb57a68db8.clean/src/emitterutils.cpp:221:29: error: template argument 1 is invalid
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |                             ^

The issue here seems to have been fixed in the master branch. If I clone my own version and build the master branch, everything compiles cleanly.

However, if I git checkout 0.8.0, the build fails with the same errors.

Perhaps a simple version tick would fix this issue?

ImOnALampshade avatar May 03 '25 10:05 ImOnALampshade

I just ran into the same thing. I fixed it by

sed -i -e 3i\"\#include <cstdint>\"  src/*.cpp

Considering that a commit seems to have been made 2 months ago, is it time for a new release?

VictorEijkhout avatar Sep 09 '25 16:09 VictorEijkhout

Hello, I experiment the same issue than @ImOnALampshade. I saw the issue was fixed in August 2024. The master branch includes the fix but not the release tag ( 0.8.0 ). Is possible to release a micro version (e.g. 0.8.1 ) ? This will fix the issue for a lot of people.

BR Régis

regisf avatar Oct 25 '25 17:10 regisf

Building from the master branch worked fine on Slackware64-current using GCC 15.2

Jancs-E avatar Jan 04 '26 08:01 Jancs-E