dyne / FreeJ

Free Vision Mixer
https://dyne.org/software/freej
GNU General Public License v3.0
40 stars 8 forks source link

Cannot compile with libpng-1.6 #5

Closed alcir closed 2 years ago

alcir commented 5 years ago

Probably starting with libpng-1.5 In lib/sdl_image/IMG_png.c

141: if ( setjmp(png_ptr->jmpbuf) ) { should be 141: if (setjmp(png_jmpbuf(png_ptr))) {

210: Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0; should be 210: Amask = (png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0;

212: int s = (info_ptr->channels == 4) ? 0 : 8; should be 212: int s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8;

220: bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask); should be 220: bit_depth*png_get_channels(png_ptr, info_ptr), Rmask,Gmask,Bmask,Amask);

270: } else if (info_ptr->num_palette > 0 ) { ¯_(ツ)_/¯ I'm not a programmer, too difficult for me to change this.

Vitexus commented 2 years ago

Still occurs. Tested on debian 11

jaromil commented 2 years ago

Just have libsdl2-image-dev installed and freej will build using the shared library, which seems to work.

Beware I'm not using freej myself since more than a decade....

Vitexus commented 2 years ago

vitex@exiv:~/tmp/FreeJ$ apt-file search SDL_image.h libsdl-image1.2-dev: /usr/include/SDL/SDL_image.h libsdl2-image-dev: /usr/include/SDL2/SDL_image.h

make[3]: Vstupuje se do adresáře „/home/vitex/tmp/FreeJ/src“
  CXX      freej.o
In file included from ../src/include/impl_layers.h:31,
                 from freej.cpp:42:
../src/include/image_layer.h:25:10: fatal error: SDL_image.h: Adresář nebo soubor neexistuje
   25 | #include <SDL_image.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

@jaromil thank you for the hint. the compilation does not recognize sdl2 but continue after install of libsdl-image1.2-dev

Then end with

...
...

  CXXLD    libfreej.la

*** Warning: Linking the shared library libfreej.la against the
*** static library ../lib/javascript/libmozjs.a is not portable!
  CXXLD    freej
/usr/bin/ld: ./.libs/libfreej.so: undefined reference to `IMG_Load'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:783: freej] Chyba 1
make[3]: Opouští se adresář „/home/vitex/tmp/FreeJ/src“
make[2]: *** [Makefile:943: all-recursive] Chyba 1
make[2]: Opouští se adresář „/home/vitex/tmp/FreeJ/src“
make[1]: *** [Makefile:616: all-recursive] Chyba 1
make[1]: Opouští se adresář „/home/vitex/tmp/FreeJ“
make: *** [Makefile:502: all] Chyba 2


There is also problem with SDL_ttf. The SDL2 version is not recognized.

But this is thing with i can work somehow. 

I think its ready for new issue "Upgrade to current libraries" on my fork. 

UPDATE: compilation has finished ... now i can continue to build deb package on my fork.
Vitexus commented 2 years ago

You can found full required dependency packages list here: https://github.com/Vitexus/FreeJ/blob/42411088f868d1071cf1f316a0a562a0b951ab32/debian/control#L6

obrazek

jaromil commented 2 years ago

Right! for text layer you need libsdl-ttf2.0-dev which is also the SDL1.2 api.