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

Build issue: filesystem/src/legacy.cpp no matching function for call to find() #1045

Closed
tim-rex opened this issue May 15, 2024 · 3 comments · Fixed by #1047
Closed

Build issue: filesystem/src/legacy.cpp no matching function for call to find() #1045

tim-rex opened this issue May 15, 2024 · 3 comments · Fixed by #1047
Assignees

Comments

@tim-rex
Copy link

tim-rex commented May 15, 2024

Following the build instructions for Linux I seem to be encountering the below

[ 44%] Building CXX object components/filesystem/CMakeFiles/vkb__filesystem.dir/src/legacy.cpp.o
/home/timk/git/khronos/Vulkan-Samples/components/filesystem/src/legacy.cpp: In function ‘void vkb::fs::create_path(const std::string&, const std::string&)’:
/home/timk/git/khronos/Vulkan-Samples/components/filesystem/src/legacy.cpp:101:31: error: no matching function for call to ‘find(__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >&, std::__cxx11::basic_string<char>::const_iterator, char)’
  101 |                 it = std::find(it, path.end(), '/');
      |                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14.1.1/bits/locale_facets.h:48,
                 from /usr/include/c++/14.1.1/bits/basic_ios.h:37,
                 from /usr/include/c++/14.1.1/ios:46,
                 from /usr/include/c++/14.1.1/istream:40,
                 from /usr/include/c++/14.1.1/fstream:40,
                 from /home/timk/git/khronos/Vulkan-Samples/components/filesystem/include/filesystem/legacy.h:22,
                 from /home/timk/git/khronos/Vulkan-Samples/components/filesystem/src/legacy.cpp:18:
/usr/include/c++/14.1.1/bits/streambuf_iterator.h:435:5: note: candidate: ‘template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)’
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14.1.1/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
/home/timk/git/khronos/Vulkan-Samples/components/filesystem/src/legacy.cpp:101:31: note:   ‘__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
  101 |                 it = std::find(it, path.end(), '/');
      |                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
make[3]: *** [components/filesystem/CMakeFiles/vkb__filesystem.dir/build.make:76: components/filesystem/CMakeFiles/vkb__filesystem.dir/src/legacy.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:3147: components/filesystem/CMakeFiles/vkb__filesystem.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:7596: app/CMakeFiles/vulkan_samples.dir/rule] Error 2
make: *** [Makefile:1815: vulkan_samples] Error 2

Here's the output from the configure stage

timk@archon Vulkan-Samples]$ cmake -G "Unix Makefiles" -Bbuild/linux -DCMAKE_BUILD_TYPE=Release
-- vulkan_library/home/timk/git/khronos/vulkansdk-linux-x86_64/1.3.280.1/x86_64/lib/libvulkan.sosearchpaths/home/timk/git/khronos/vulkansdk-linux-x86_64/1.3.280.1/x86_64/lib
-- Found Vulkan: /home/timk/git/khronos/vulkansdk-linux-x86_64/1.3.280.1/x86_64/lib/libvulkan.so (found version "1.3.280") found components: glslc glslangValidator
Found DirectX Shader Compiler under /home/timk/git/khronos/vulkansdk-linux-x86_64/1.3.280.1/x86_64/bin/dxc
-- The C compiler identification is GNU 14.1.1
-- The CXX compiler identification is GNU 14.1.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
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1")
-- Checking for module 'xcb'
--   Found xcb, version 1.17.0
-- spirv-tools not linked - illegal SPIRV may be generated for HLSL
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
CMake Deprecation Warning at third_party/spirv-cross/CMakeLists.txt:22 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- SPIRV-Cross: Finding Git version for SPIRV-Cross.
-- Found Git: /usr/bin/git (found version "2.45.0")
-- SPIRV-Cross: Git hash: 7512345f
CMake Warning (dev) at third_party/spirv-cross/CMakeLists.txt:462 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python (found version "3.12.3")
SPIRV-Cross:  Testing will be disabled for SPIRV-Cross. Could not find glslang or SPIRV-Tools build under external/. To enable testing, run ./checkout_glslang_spirv_tools.sh and ./build_glslang_spirv_tools.sh first.
-- Try AVX2 C flag = [ ]
-- Performing Test HAVE_AVX2
-- Performing Test HAVE_AVX2 - Failed
-- Try AVX2 C flag = [-march=core-avx2]
-- Performing Test HAVE_AVX2
-- Performing Test HAVE_AVX2 - Success
-- Found AVX2: -march=core-avx2
-- Performing Test HAVE_AVX2_MM256_SET1_EPI64X
-- Performing Test HAVE_AVX2_MM256_SET1_EPI64X - Success
-- Performing Test HAVE_AVX2_MM256_SET_EPI64X
-- Performing Test HAVE_AVX2_MM256_SET_EPI64X - Success
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI64
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI64 - Success
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI32
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI32 - Success
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI16
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI16 - Success
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI8
-- Performing Test HAVE_AVX2_MM256_INSERT_EPI8 - Success
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI64
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI64 - Success
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI32
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI32 - Success
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI16
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI16 - Success
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI8
-- Performing Test HAVE_AVX2_MM256_EXTRACT_EPI8 - Success
-- Try SSE2 C flag = [ ]
-- Performing Test HAVE_SSE2
-- Performing Test HAVE_SSE2 - Success
-- Found SSE2:
-- Performing Test HAVE_SSE2_MM_SET1_EPI64X
-- Performing Test HAVE_SSE2_MM_SET1_EPI64X - Success
-- Performing Test HAVE_SSE2_MM_SET_EPI64X
-- Performing Test HAVE_SSE2_MM_SET_EPI64X - Success
-- Try NEON C flag = [ ]
-- Performing Test HAVE_NEON
-- Performing Test HAVE_NEON - Failed
-- Try NEON C flag = [-mfpu=neon]
-- Performing Test HAVE_NEON
-- Performing Test HAVE_NEON - Failed
-- Try NEON C flag = [-mfpu=neon -mfloat-abi=softfp]
-- Performing Test HAVE_NEON
-- Performing Test HAVE_NEON - Failed
-- Could NOT find NEON (missing: NEON_C_FLAGS) 
--   AVX2 backend     - ON
--   SSE4.1 backend   - OFF
--   SSE2 backend     - OFF
--   NEON backend     - OFF
--   NONE backend     - OFF
--   NATIVE backend   - OFF
--   Invariance       - ON
--   Shared libs      - OFF
--   Decompressor     - ON
--   Diagnostics      - OFF
--   ASAN             - OFF
--   Unit tests       - OFF
-- Including X11 support
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Version: 10.1.1
-- Build type: Release
-- Build spdlog: 1.12.0
-- Build type: Release
CMake Deprecation Warning at third_party/cli11/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Performing Test HAVE_FLAG__ffile_prefix_map__home_timk_git_khronos_Vulkan_Samples_third_party_catch2__
-- Performing Test HAVE_FLAG__ffile_prefix_map__home_timk_git_khronos_Vulkan_Samples_third_party_catch2__ - Success
-- STATIC: vkb__core
-- STATIC: vkb__unix_platform
-- STATIC: vkb__filesystem
-- Unix platform detected
-- Warnings as Errors Enabled
-- Sample `compute_nbody` - BUILD
-- Sample `dynamic_uniform_buffers` - BUILD
-- Sample `hdr` - BUILD
-- Sample `hello_triangle` - BUILD
-- Sample `hlsl_shaders` - BUILD
-- Sample `hpp_compute_nbody` - BUILD
-- Sample `hpp_dynamic_uniform_buffers` - BUILD
-- Sample `hpp_hdr` - BUILD
-- Sample `hpp_hello_triangle` - BUILD
-- Sample `hpp_hlsl_shaders` - BUILD
-- Sample `hpp_instancing` - BUILD
-- Sample `hpp_oit_linked_lists` - BUILD
-- Sample `hpp_separate_image_sampler` - BUILD
-- Sample `hpp_terrain_tessellation` - BUILD
-- Sample `hpp_texture_loading` - BUILD
-- Sample `hpp_texture_mipmap_generation` - BUILD
-- Sample `hpp_timestamp_queries` - BUILD
-- Sample `instancing` - BUILD
-- Sample `oit_depth_peeling` - BUILD
-- Sample `oit_linked_lists` - BUILD
-- Sample `separate_image_sampler` - BUILD
-- Sample `swapchain_recreation` - BUILD
-- Sample `terrain_tessellation` - BUILD
-- Sample `texture_loading` - BUILD
-- Sample `texture_mipmap_generation` - BUILD
-- Sample `timestamp_queries` - BUILD
-- Sample `buffer_device_address` - BUILD
-- Sample `calibrated_timestamps` - BUILD
-- Sample `color_write_enable` - BUILD
-- Sample `conditional_rendering` - BUILD
-- Sample `conservative_rasterization` - BUILD
-- Sample `debug_utils` - BUILD
-- Sample `descriptor_buffer_basic` - BUILD
-- Sample `descriptor_indexing` - BUILD
-- Sample `dynamic_blending` - BUILD
-- Sample `dynamic_line_rasterization` - BUILD
-- Sample `dynamic_primitive_clipping` - BUILD
-- Sample `dynamic_rendering` - BUILD
-- Sample `extended_dynamic_state2` - BUILD
-- Sample `fragment_shader_barycentric` - BUILD
-- Sample `fragment_shading_rate` - BUILD
-- Sample `fragment_shading_rate_dynamic` - BUILD
-- Sample `graphics_pipeline_library` - BUILD
-- Sample `gshader_to_mshader` - BUILD
-- Sample `hpp_mesh_shading` - BUILD
-- Sample `logic_op_dynamic_state` - BUILD
-- Sample `memory_budget` - BUILD
-- Sample `mesh_shader_culling` - BUILD
-- Sample `mesh_shading` - BUILD
-- Sample `open_cl_interop` - BUILD
-- Sample `open_gl_interop` - BUILD
-- Sample `patch_control_points` - BUILD
-- Sample `portability` - BUILD
-- Sample `push_descriptors` - BUILD
-- Sample `ray_queries` - BUILD
-- Sample `ray_tracing_basic` - BUILD
-- Sample `ray_tracing_extended` - BUILD
-- Sample `ray_tracing_reflection` - BUILD
-- Sample `shader_debugprintf` - BUILD
-- Sample `shader_object` - BUILD
-- Sample `sparse_image` - BUILD
-- Sample `synchronization_2` - BUILD
-- Sample `timeline_semaphore` - BUILD
-- Sample `vertex_dynamic_state` - BUILD
-- Sample `mobile_nerf` - BUILD
-- Sample `16bit_arithmetic` - BUILD
-- Sample `16bit_storage_input_output` - BUILD
-- Sample `afbc` - BUILD
-- Sample `async_compute` - BUILD
-- Sample `command_buffer_usage` - BUILD
-- Sample `constant_data` - BUILD
-- Sample `descriptor_management` - BUILD
-- Sample `hpp_pipeline_cache` - BUILD
-- Sample `hpp_swapchain_images` - BUILD
-- Sample `image_compression_control` - BUILD
-- Sample `layout_transitions` - BUILD
-- Sample `msaa` - BUILD
-- Sample `multi_draw_indirect` - BUILD
-- Sample `multithreading_render_passes` - BUILD
-- Sample `pipeline_barriers` - BUILD
-- Sample `pipeline_cache` - BUILD
-- Sample `render_passes` - BUILD
-- Sample `specialization_constants` - BUILD
-- Sample `subpasses` - BUILD
-- Sample `surface_rotation` - BUILD
-- Sample `swapchain_images` - BUILD
-- Sample `texture_compression_basisu` - BUILD
-- Sample `texture_compression_comparison` - BUILD
-- Sample `wait_idle` - BUILD
-- Sample `profiles` - BUILD
-- Plugin `batch_mode` - BUILD
-- Plugin `benchmark_mode` - BUILD
-- Plugin `data_path` - BUILD
-- Plugin `file_logger` - BUILD
-- Plugin `force_close` - BUILD
-- Plugin `fps_logger` - BUILD
-- Plugin `gpu_selection` - BUILD
-- Plugin `real_time_shader_selection` - BUILD
-- Plugin `screenshot` - BUILD
-- Plugin `start_sample` - BUILD
-- Plugin `stop_after` - BUILD
-- Plugin `user_interface_options` - BUILD
-- Plugin `window_options` - BUILD
-- Configuring done (5.7s)
-- Generating done (0.3s)
-- Build files have been written to: /home/timk/git/khronos/Vulkan-Samples/build/linux

@SaschaWillems
Copy link
Collaborator

Can you test if it works when adding #include <algorithm> the file that causes this error?

@tim-rex
Copy link
Author

tim-rex commented May 15, 2024

That did the trick, cheers @SaschaWillems

@SaschaWillems
Copy link
Collaborator

Thanks for testing. We'll fix this and add that include.

@SaschaWillems SaschaWillems self-assigned this May 16, 2024
SaschaWillems added a commit to SaschaWillems/Vulkan-Samples that referenced this issue May 17, 2024
tomadamatkinson pushed a commit that referenced this issue May 29, 2024
* Clean up api sample base class interfaces

* Revert "Clean up api sample base class interfaces"

This reverts commit 7504395.

* Add algorithm header
Fixes #1045

* Reorder includes
Fixes clang-format
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

Successfully merging a pull request may close this issue.

2 participants