That's because you need to use the updated libstdc++.so of the gcc version you used to compile. Note that this file is not (IIRC) backwards compatible with the one currently in SOBJS: and will break existing programs if put there, so you should include it with your program in PROGDIR:SObjs instead.
So when new full SDK is out and new/updated GCC and thus stdc++.so then there should be no such requester/problem.
IIRC one of the solutions that was discussed was to build the new libstdc++.so with a different name so that it can be installed next to the old version without causing any conflicts.
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg
Thank you for your work on newlib...if you need someone to test shared, just shout (I feel like I told you that already)
@capehill
Thank you for your continuous work on sdl
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg
I am following multi-platform SDL2 tutorials on this page. I was able to compile and run first 5 examples. However I have a difficulty with SDL2_image.
The example basically loads a PNG file and displays on the screen.
I am compiling the examples with this following command ppc-amigaos-g++ -w -athread=native 06_extension_libraries_and_loading_other_image_formats.cpp -o 06_SDL -lSDL2_image -lSDL2
However I get following errors: $ ppc-amigaos-g++ -w -athread=native 06_extension_libraries_and_loading_other_image_formats.cpp -o 06_SDL -lSDL2_image -lSDL2 /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_jpg.o): In function `IMG_SaveJPG_RW_jpeglib': /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:499: undefined reference to `jpeg_std_error' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:503: undefined reference to `jpeg_CreateCompress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:511: undefined reference to `jpeg_set_defaults' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:512: undefined reference to `jpeg_set_quality' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:513: undefined reference to `jpeg_start_compress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:518: undefined reference to `jpeg_write_scanlines' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:521: undefined reference to `jpeg_finish_compress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:522: undefined reference to `jpeg_destroy_compress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:499: undefined reference to `jpeg_std_error' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:503: undefined reference to `jpeg_CreateCompress' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_jpg.o): In function `IMG_LoadJPG_RW': /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:339: undefined reference to `jpeg_std_error' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:353: undefined reference to `jpeg_CreateDecompress' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_jpg.o): In function `jpeg_SDL_RW_src': /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:296: undefined reference to `jpeg_resync_to_restart' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:296: undefined reference to `jpeg_resync_to_restart' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_jpg.o): In function `IMG_LoadJPG_RW': /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:355: undefined reference to `jpeg_read_header' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:381: undefined reference to `jpeg_calc_output_dimensions' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:402: undefined reference to `jpeg_start_decompress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:406: undefined reference to `jpeg_read_scanlines' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:408: undefined reference to `jpeg_finish_decompress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:409: undefined reference to `jpeg_destroy_decompress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:344: undefined reference to `jpeg_destroy_decompress' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:361: undefined reference to `jpeg_calc_output_dimensions' /home/Michael/SDL2_image-2.0.5/IMG_jpg.c:395: undefined reference to `jpeg_destroy_decompress' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_png.o): In function `png_read_data': /home/Michael/SDL2_image-2.0.5/IMG_png.c:246: undefined reference to `png_get_io_ptr' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_png.o): In function `png_write_data': /home/Michael/SDL2_image-2.0.5/IMG_png.c:526: undefined reference to `png_get_io_ptr' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_png.o): In function `IMG_SavePNG_RW_libpng': /home/Michael/SDL2_image-2.0.5/IMG_png.c:544: undefined reference to `png_create_write_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:550: undefined reference to `png_create_info_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:558: undefined reference to `png_set_longjmp_fn' /home/Michael/SDL2_image-2.0.5/IMG_png.c:586: undefined reference to `png_set_PLTE' /home/Michael/SDL2_image-2.0.5/IMG_png.c:593: undefined reference to `png_set_write_fn' /home/Michael/SDL2_image-2.0.5/IMG_png.c:595: undefined reference to `png_set_IHDR' /home/Michael/SDL2_image-2.0.5/IMG_png.c:613: undefined reference to `png_set_rows' /home/Michael/SDL2_image-2.0.5/IMG_png.c:614: undefined reference to `png_write_png' /home/Michael/SDL2_image-2.0.5/IMG_png.c:621: undefined reference to `png_destroy_write_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:552: undefined reference to `png_destroy_write_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:564: undefined reference to `png_destroy_write_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:605: undefined reference to `png_destroy_write_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:577: undefined reference to `png_destroy_write_struct' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_png.o): In function `IMG_LoadPNG_RW': /home/Michael/SDL2_image-2.0.5/IMG_png.c:283: undefined reference to `png_create_read_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:291: undefined reference to `png_create_info_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:304: undefined reference to `png_set_longjmp_fn' /home/Michael/SDL2_image-2.0.5/IMG_png.c:458: undefined reference to `png_destroy_read_struct' /home/Michael/SDL2_image-2.0.5/IMG_png.c:314: undefined reference to `png_set_read_fn' /home/Michael/SDL2_image-2.0.5/IMG_png.c:317: undefined reference to `png_read_info' /home/Michael/SDL2_image-2.0.5/IMG_png.c:318: undefined reference to `png_get_IHDR' /home/Michael/SDL2_image-2.0.5/IMG_png.c:322: undefined reference to `png_set_strip_16' /home/Michael/SDL2_image-2.0.5/IMG_png.c:325: undefined reference to `png_set_interlace_handling' /home/Michael/SDL2_image-2.0.5/IMG_png.c:330: undefined reference to `png_set_packing' /home/Michael/SDL2_image-2.0.5/IMG_png.c:334: undefined reference to `png_set_expand' /home/Michael/SDL2_image-2.0.5/IMG_png.c:339: undefined reference to `png_get_valid' /home/Michael/SDL2_image-2.0.5/IMG_png.c:369: undefined reference to `png_set_gray_to_rgb' /home/Michael/SDL2_image-2.0.5/IMG_png.c:371: undefined reference to `png_read_update_info' /home/Michael/SDL2_image-2.0.5/IMG_png.c:373: undefined reference to `png_get_IHDR' /home/Michael/SDL2_image-2.0.5/IMG_png.c:378: undefined reference to `png_get_channels' /home/Michael/SDL2_image-2.0.5/IMG_png.c:423: undefined reference to `png_read_image' /home/Michael/SDL2_image-2.0.5/IMG_png.c:438: undefined reference to `png_get_PLTE' /home/Michael/SDL2_image-2.0.5/IMG_png.c:342: undefined reference to `png_get_tRNS' /home/Michael/SDL2_image-2.0.5/IMG_png.c:361: undefined reference to `png_set_expand' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_tif.o): In function `IMG_LoadTIF_RW': /home/Michael/SDL2_image-2.0.5/IMG_tif.c:179: undefined reference to `TIFFClientOpen' /home/Michael/SDL2_image-2.0.5/IMG_tif.c:185: undefined reference to `TIFFGetField' /home/Michael/SDL2_image-2.0.5/IMG_tif.c:186: undefined reference to `TIFFGetField' /home/Michael/SDL2_image-2.0.5/IMG_tif.c:197: undefined reference to `TIFFReadRGBAImageOriented' /home/Michael/SDL2_image-2.0.5/IMG_tif.c:210: undefined reference to `TIFFClose' /home/Michael/SDL2_image-2.0.5/IMG_tif.c:200: undefined reference to `TIFFClose' /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libSDL2_image.a(IMG_webp.o): In function `IMG_LoadWEBP_RW': /home/Michael/SDL2_image-2.0.5/IMG_webp.c:201: undefined reference to `WebPGetFeaturesInternal' /home/Michael/SDL2_image-2.0.5/IMG_webp.c:232: undefined reference to `WebPDecodeRGBAInto' /home/Michael/SDL2_image-2.0.5/IMG_webp.c:234: undefined reference to `WebPDecodeRGBInto' collect2: error: ld returned 1 exit status
@Capehill When using -athread=native for big enough projects, -lpthreads usually need it. At least for c++ code for sure (i.e. not SDL2 related, but compiler itself)
Wasn't there a separate threading model -athread=pthreads or similar for using posix threads? (single, native and pthreads?)
Yeah, there "single" and "native" for now. Also it has "pthread", but by default that file not compiled in (need gthr-amigaos-pthread.o, which can be build separately from adtools repo, but this one luck important functions implementations, so of no real use now, see: https://github.com/sba1/adtools/issues/95)
Quote:
There was nothing about pthreads in Sinan's linking errors, hence I don't understand why to link with pthreads?
Maybe he just copy+paste, or maybe some of those 3d party libs need pthreads, and errors he has only arisen after he link with them :)