stable-diffusion.cpp icon indicating copy to clipboard operation
stable-diffusion.cpp copied to clipboard

[Bug] error

Open Damian-o2 opened this issue 2 weeks ago • 3 comments

Git commit

[ 95%] Building CXX object examples/cli/CMakeFiles/sd-cli.dir//common/log.cpp.o [ 95%] Building CXX object examples/cli/CMakeFiles/sd-cli.dir//common/media_io.cpp.o In file included from /stable-diffusion.cpp/examples/common/media_io.cpp:21: /stable-diffusion.cpp/thirdparty/stb_image.h: In function ‘int stbi__parse_png_file(stbi__png*, int, int)’: stable-diffusion.cpp/thirdparty/stb_image.h:5166:56: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 5166 | for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stable-diffusion.cpp/thirdparty/stb_image.h:5082:25: note: at offset 3 into destination object ‘tc’ of size 3 5082 | stbi_uc has_trans=0, tc[3]={0}; | ^~ [ 95%] Building CXX object examples/cli/CMakeFiles/sd-cli.dir/__/common/media_metadata.cpp.o [ 96%] Building CXX object examples/cli/CMakeFiles/sd-cli.dir/image_metadata.cpp.o

Operating System & Version

Ubuntu last

GGML backends

CUDA

Command-line arguments used

cmake --build build --config Release

Steps to reproduce

cmake -S . -B build -DSD_CUDA=ON -DSD_CUDA_CUTLASS_PATH:PATH=

What you expected to happen

image_metadata.cpp:419:18: warning: ‘template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc> class std::__cxx11::wstring_convert’ is deprecated [-Wdeprecated-declarations] 419 | std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> converter;

What actually happened

cli/image_metadata.cpp:8: /usr/include/c++/15/bits/locale_conv.h:262:33: note: declared here 262 | class _GLIBCXX17_DEPRECATED wstring_convert

Logs / error messages / stack trace

collect2: error: ld returned 1 exit status gmake[2]: *** [examples/cli/CMakeFiles/sd-cli.dir/build.make:222: bin/sd-cli] Błąd 1 gmake[1]: *** [CMakeFiles/Makefile2:1180: examples/cli/CMakeFiles/sd-cli.dir/all] Błąd 2 gmake: *** [Makefile:136: all] Błąd 2

Additional context / environment details

No response

Damian-o2 avatar Nov 20 '26 18:11 Damian-o2

collect2: error: ld returned 1 exit status gmake[2]: *** [examples/cli/CMakeFiles/sd-cli.dir/build.make:222: bin/sd-cli] Błąd 1 gmake[1]: *** [CMakeFiles/Makefile2:1180: examples/cli/CMakeFiles/sd-cli.dir/all] Błąd 2 gmake: *** [Makefile:136: all] Błąd 2

Unfortunately, this is missing the actual error; the other messages are warnings that shouldn't cause a build failure. Please post the complete build output.

wbruna avatar Nov 20 '26 19:11 wbruna

stable-diffusion.cpp/thirdparty/stb_image.h:5166:56: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 5166 | for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger

examples/cli/image_metadata.cpp: In function ‘json {anonymous}::parse_exif_user_comment(const uint8_t*, size_t)’:

Damian-o2 avatar Nov 20 '26 21:11 Damian-o2

simple sollution

-DCMAKE_CXX_COMPILER=g++-13

Damian-o2 avatar Nov 21 '26 07:11 Damian-o2