Compile libexif with Visual Studio

  • Post category:IT
  • Post comments:0 commentaire
  • Post last modified:10 novembre 2018
  • Temps de lecture :2 min de lecture

Compile library with Visual Studio is not always easy if those have not been designed for Windows. This is the case for libexif.

Homepage :

Version used : 0.6.1

Steps :

  • Download and uncompress the source code
  • Create a win32 folder in the source tree (the one containing libexif, contrib, po,…)
  • Create a Visual Studio project in this folder (select the .lib template)
  • Add all files in libexif/ with the subfolders
  • Download a copy from config.h written by Anthony Lawrence from
  • Modify it with your libexif version, and with the other changes you may want
  • Be carefull to exclude from include and lib paths any existing libexif installation
  • Add ‘.’ and ‘..’ in your include paths (to find config.h and <libexif/*>)
  • Modify the file exif-entry.c on the line 1384 (unsigned short *utf16 = exif_mem_alloc (e→priv→mem, e→size+sizeof(unsigned short));) and move to the beginning of the scope the declaration of utf16 variable (line 833 : unsigned short *utf16;)
  • Add preprocessor definitions : GETTEXT_PACKAGE=“libexif-12”;LOCALEDIR=
  • And lastly, modify options according to that you need ; in my case (for RPhoto) :
    • Unicode
    • Set to MultiThread (/MT)
    • Static Library

It should compile and link well now.

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.