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

FileHelper.h:8:62: error: ‘size_t’ has not been declared #7

Open
djkato opened this issue Oct 15, 2024 · 0 comments
Open

FileHelper.h:8:62: error: ‘size_t’ has not been declared #7

djkato opened this issue Oct 15, 2024 · 0 comments

Comments

@djkato
Copy link

djkato commented Oct 15, 2024

hello,
When I tried to compile https://github.com/pcwalton/gltf-ibl-sampler-egui , it kept failing on FileHelper.h:8:62: error: ‘size_t’ has not been declared. All I did is clone this repo.
I'm not knowledgeable about cpp, so this is all I can provide. Probably I'm doing something wrong, would be nice to know what.

djkato@djkato-vfx ~/C/g/glTF-IBL-Sampler (master)> cmake .
-- The C compiler identification is GNU 11.4.1
-- The CXX compiler identification is GNU 11.4.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 'IBLSAMPLER_EXPORT_SHADERS' is FALSE
volk: using VULKAN_HEADERS_INSTALL_DIR option
-- 
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler

djkato@djkato-vfx ~/C/g/glTF-IBL-Sampler (master)> make
[  9%] Building C object thirdparty/volk/CMakeFiles/volk.dir/volk.c.o
[ 18%] Linking C static library libvolk.a
[ 18%] Built target volk
[ 27%] Building CXX object CMakeFiles/GltfIblSampler.dir/lib/source/FileHelper.cpp.o
In file included from /home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/FileHelper.cpp:1:
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/FileHelper.h:8:62: error: ‘size_t’ has not been declared
    8 |         bool writeFile(const char* _path, const char* _data, size_t _bytes);
      |                                                              ^~~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/FileHelper.cpp:28:75: error: ‘bool IBLLib::writeFile(const char*, const char*, size_t)’ should have been declared inside ‘IBLLib’
   28 | bool IBLLib::writeFile(const char* _path, const char* _data, size_t _bytes)
      |                                                                           ^
make[2]: *** [CMakeFiles/GltfIblSampler.dir/build.make:76: CMakeFiles/GltfIblSampler.dir/lib/source/FileHelper.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/GltfIblSampler.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

When trying to fix like:
lib/source/FileHelper.h

-bool writeFile(const char *_path, const char *_data, size_t _bytes);
+bool writeFile(const char *_path, const char *_data, std::size_t _bytes);

It spewed more errors, and also found some missing files... This is beyond me, shame I can't use this tool.

djkato@djkato-vfx ~/C/g/glTF-IBL-Sampler (lite) [2]> make
[ 18%] Built target volk
[ 27%] Building CXX object CMakeFiles/GltfIblSampler.dir/lib/source/FileHelper.cpp.o
[ 36%] Building CXX object CMakeFiles/GltfIblSampler.dir/lib/source/STBImage.cpp.o
[ 45%] Building CXX object CMakeFiles/GltfIblSampler.dir/lib/source/format.cpp.o
[ 54%] Building CXX object CMakeFiles/GltfIblSampler.dir/lib/source/ktxImage.cpp.o
[ 63%] Building CXX object CMakeFiles/GltfIblSampler.dir/lib/source/lib.cpp.o
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp: In function ‘void IBLLib::convertImageOnCPU(std::vector<unsigned char>&, const std::vector<unsigned char>&, VkFormat, VkFormat)’:
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:288:42: error: ‘fminf’ was not declared in this scope
  288 |                 float redC = fmaxf(0.0f, fminf(sharedexpMax, r));
      |                                          ^~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:288:30: error: ‘fmaxf’ was not declared in this scope
  288 |                 float redC = fmaxf(0.0f, fminf(sharedexpMax, r));
      |                              ^~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:294:57: error: ‘log2f’ was not declared in this scope
  294 |                 float expSharedP = fmaxf(-16.0f, floorf(log2f(maxC))) + 16.0f;
      |                                                         ^~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:294:50: error: ‘floorf’ was not declared in this scope
  294 |                 float expSharedP = fmaxf(-16.0f, floorf(log2f(maxC))) + 16.0f;
      |                                                  ^~~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:296:44: error: ‘powf’ was not declared in this scope
  296 |                 float maxS = floorf(maxC / powf(2.0f, expSharedP - B - N) + 0.5f);
      |                                            ^~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp: In function ‘IBLLib::Result IBLLib::sample(const char*, const char*, const char*, IBLLib::Distribution, unsigned int, unsigned int, unsigned int, IBLLib::OutputFormat, float, bool)’:
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:871:87: error: ‘log2’ was not declared in this scope
  871 |         _mipmapCount = _mipmapCount != 0 ? _mipmapCount : static_cast<uint32_t>(floor(log2(_cubemapResolution)));
      |                                                                                       ^~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:871:81: error: ‘floor’ was not declared in this scope
  871 |         _mipmapCount = _mipmapCount != 0 ? _mipmapCount : static_cast<uint32_t>(floor(log2(_cubemapResolution)));
      |                                                                                 ^~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:1092:25: warning: comparison between ‘enum IBLLib::Result’ andenum VkResult’ [-Wenum-compare]
 1092 |                 if (res != VK_SUCCESS)
      |                     ~~~~^~~~~~~~~~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:1234:140: warning: comparison between ‘enum IBLLib::Result’ andenum VkResult’ [-Wenum-compare]
 1234 |         if (downloadCubemap(vulkan, convertedCubeMap, _outputPathCubeMap, static_cast<VkFormat>(_targetFormat), currentCubeMapImageLayout) != VK_SUCCESS)
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/djkato/Code/gltf-ibl-sampler-egui/glTF-IBL-Sampler/lib/source/lib.cpp:1242:114: warning: comparison between ‘enum IBLLib::Result’ andenum VkResult’ [-Wenum-compare]
 1242 |                 if (download2DImage(vulkan, outputLUT, _outputPathLUT, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) != VK_SUCCESS)
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/GltfIblSampler.dir/build.make:132: CMakeFiles/GltfIblSampler.dir/lib/source/lib.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/GltfIblSampler.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant