简体   繁体   中英

Imlib2: Saving image returns IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT

I want to link my program against a static version of imlib2
So I cloned the imlib2 repo from https://git.enlightenment.org/legacy/imlib2.git/ and compiled a static lib from it (libImlib2.a).
This one I added into my Makefile LDFLAGS =./libs/libImlib2.a , added the include file also and compiled my program.
But as soon as I call imlib_save_image_with_error_return(filename, &err);
I get the error IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT in return.
Yeah, I guess this should tell me that the image loader is not found. But I wanted to write a simple jpg file and the ./configure command told me that the jpeg loader is included.

------------------------------------------------------------------------
imlib2 1.7.1
------------------------------------------------------------------------

Configuration Options Summary:

Image loaders:
  JPEG....................: yes
  PNG.....................: yes
  TIFF....................: yes
  GIF.....................: yes
  WEBP....................: no
  ZLIB....................: yes
  BZIP2...................: yes
  ID3.....................: yes

Does anyone know what I'm doing wrong?
Many thanks in advance for any help.

Ok, after digging a little deeper into the imlib2 source it turns out that the loaders are always looked up as shared objects. I thought the loaders are also compiled into the static lib, but I was wrong.

Either I can set the directory by specifying IMLIB2_LOADER_PATH or by putting them into the default loader path which is /usr/local/lib/imlib2/loaders in the self compiled version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM