Yes, I've been able to link FreeImage statically on several Visual studio versions. Here I describe how I do this usually.
With FreeImage, by default, we have 8 options to link it to your app:
FreeImage - dynamic link (you will need dll).
FreeImageLib - static link.
Each of these can be built with "Debug" or with "Release" configurations and for Win32 or Win64 platforms.
So, assume that we need ( Static && Win32 && Debug ) and ( Static && Win32 && Release ) variants for our app. Also in our app we use Dynamic Runtime Library (by default, FreeImage set up for static for some reason) How we usually got it:
Download and unpack fresh version (or at least clean up old distib)
Open
FreeImage.2008.sln
select ALL of 10 projects with Shift+click. Then in "Project(s) Properties / C++ / Code generation" we choose /MDd for "Debug" configuration and /MD for "Release".Then we go to "Menu / Build / Batch build", select:
FreeImageLib | Debug | Win32
FreeImageLib | Release | Win32
and press "Build".
Wait for choosen configurations built. All what we need will be copied in
FreeImage\Dist
folderin
FreeImage\Dist
folder check files:delete.me
FreeImage.h
FreeImage.lib
FreeImaged.lib
Check creation date and time. It must be fresh baked and hot. If they not, copy them fromFreeImage\Source\FreeImageLib\Debug
andFreeImage\Source\FreeImageLib\Release
.- In main applicaion add to include and lib
FreeImage\Dist
and linkFreeImaged.lib
to Debug configurations andFreeImage.lib
to Releases. Include in source file:
#define FREEIMAGE_LIB
#include "FreeImage.h"
Try to call
FreeImage_Initialise();
FreeImage_DeInitialise();
It should work
Happy coding!