wdas / partio

C++ (with python bindings) library for easily reading/writing/manipulating common animation particle formats such as PDB, BGEO, PTC. https://wdas.github.io/partio
https://www.disneyanimation.com/open-source/partio/
Other
458 stars 133 forks source link

ubuntu22.4_error: ‘istream’ is not a member of ‘std’ #107

Open xieyouchen opened 3 months ago

xieyouchen commented 3 months ago

Hi! I found an error when I build my project on Ubuntu22.4 with gcc/g++ 1.1, cmake3.28.1 And the error maybe from the partio libarary. If someone can give me some advice, I would appreciate it.

[1/3] Building CXX object external/par...lib/CMakeFiles/partio.dir/io/PRT.cpp.o FAILED: external/partio/src/lib/CMakeFiles/partio.dir/io/PRT.cpp.o

/usr/bin/c++ -Dpartio_EXPORTS -I/tmp/tmp.N1TGuCtCNm/include -I/tmp/tmp.N1TGuCtCNm/external/glad/include -I/tmp/tmp.N1TGuCtCNm/external/partio/src/lib -I/tmp/tmp.N1TGuCtCNm/external/spdlog/include -g -std=c++11 -fPIC -fdiagnostics-color=always -w -Wextra -Wno-unused-parameter -MD -MT external/partio/src/lib/CMakeFiles/partio.dir/io/PRT.cpp.o -MF external/partio/src/lib/CMakeFiles/partio.dir/io/PRT.cpp.o.d -o external/partio/src/lib/CMakeFiles/partio.dir/io/PRT.cpp.o -c /tmp/tmp.N1TGuCtCNm/external/partio/src/lib/io/PRT.cpp

/tmp/tmp.N1TGuCtCNm/external/partio/src/lib/io/PRT.cpp:95:30: error: ‘istream’ is not a member of ‘std’ 95 | static bool read_buffer(std::istream& is, z_stream& z, char in_buf, void p, size_t size, std::ostream* errorStream) { | ^~~

/tmp/tmp.N1TGuCtCNm/external/partio/src/lib/io/PRT.cpp:92:1: note: ‘std::istream’ is defined in header ‘’; did you forget to ‘#include ’? 91 | #include "half2float.h" +++ |+#include 92 | };

davvid commented 3 months ago

Hmm.. I'm on debian/testing (gcc 13.2) and it builds okay for me here. I'm pretty sure we have source compatibility with compilers going back to gcc 4.6 but maybe I don't have all of the optional dependencies enabled.

Here's a wild guess.. try adding #include <iostream> to src/lib/io/PRT.cpp before the //#define USE_ILMHALF comment. If that compiles correctly in your environment please share a PR and we can merge that in.

xieyouchen commented 3 months ago

这是来自QQ邮箱的假期自动回复邮件。您好,您的邮件我已收到,谢谢。