Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: size_t #4382

Closed
derenv opened this issue Feb 10, 2022 · 1 comment
Closed

Bug: size_t #4382

derenv opened this issue Feb 10, 2022 · 1 comment
Labels
Bug Global flag to mark a deviation from expected behaviour Build Global flag to mark build relates topics

Comments

@derenv
Copy link

derenv commented Feb 10, 2022

Describe the bug
current main branch failed to build, citing a missing ‘#include ’.

In file included from code/Common/Compression.cpp:42:
code/Common/Compression.h:73:5: error: ‘size_t’ does not name a type
   73 |     size_t decompress(unsigned char *data, size_t in, std::vector<unsigned char> &uncompressed);
      |     ^~~~~~
code/Common/Compression.h:45:1: note: ‘size_t’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
   44 | #include <vector>
  +++ |+#include <cstddef>
   45 | 
code/Common/Compression.cpp:95:8: error: no declaration matches ‘size_t Assimp::Compression::decompress(unsigned char*, size_t, std::vector<unsigned char>&)’
   95 | size_t Compression::decompress(unsigned char *data, size_t in, std::vector<unsigned char> &uncompressed) {
      |        ^~~~~~~~~~~
code/Common/Compression.cpp:95:8: note: no functions named ‘size_t Assimp::Compression::decompress(unsigned char*, size_t, std::vector<unsigned char>&)’
In file included from code/Common/Compression.cpp:42:
code/Common/Compression.h:49:7: note: ‘class Assimp::Compression’ defined here
   49 | class Compression {
      |       ^~~~~~~~~~~
make[2]: *** [code/CMakeFiles/assimp.dir/build.make:104: code/CMakeFiles/assimp.dir/Common/Compression.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:178: code/CMakeFiles/assimp.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

To Reproduce
Steps to reproduce the behavior:

  1. git clone git@github.com:assimp/assimp.git
  2. cd assimp
  3. cmake CMakeLists.txt
  4. make -j6
  5. See error

Platform (please complete the following information):

  • Manjaro KDE
  • Version: most recent main branch commit (ie dcd5c1d)

Expected behavior
Should compile as normal, building a shared lib.

Solution
fixed with following patches:

patch -ulbf code/Common/Compression.cpp << EOF
--- a/code/Common/Compression.cpp
+++ b/code/Common/Compression.cpp
@@ -92,7 +92,7 @@ bool Compression::open() {
 
 constexpr size_t MYBLOCK = 1024;
 
-size_t Compression::decompress(unsigned char *data, size_t in, std::vector<unsigned char> &uncompressed) {
+std::size_t Compression::decompress(unsigned char *data, std::size_t in, std::vector<unsigned char> &uncompressed) {
     ai_assert(mImpl != nullptr);
 
     mImpl->mZSstream.next_in = reinterpret_cast<Bytef *>(data);
EOF

and

patch -ulbf code/Common/Compression.h << EOF
--- a/code/Common/Compression.h
+++ b/code/Common/Compression.h
@@ -70,7 +70,7 @@ public:
     /// @param[in] data         The data to decompress
     /// @param[in] in           The size of the data.
     /// @param[out uncompressed A std::vector containing the decompressed data.
-    size_t decompress(unsigned char *data, size_t in, std::vector<unsigned char> &uncompressed);
+    std::size_t decompress(unsigned char *data, std::size_t in, std::vector<unsigned char> &uncompressed);
 
 private:
     struct impl;
EOF
@derenv derenv added the Bug Global flag to mark a deviation from expected behaviour label Feb 10, 2022
@derenv derenv changed the title Bug: Bug: size_t Feb 10, 2022
@kimkulling kimkulling added the Build Global flag to mark build relates topics label Feb 11, 2022
@kimkulling
Copy link
Member

Closed by #4380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour Build Global flag to mark build relates topics
Projects
None yet
Development

No branches or pull requests

2 participants