image - FreeImage include in c -


is there way include http://freeimage.sourceforge.net/index.html in c test program without first installing library? fails compile because of memset..

here c code. there way make work? please try compiling , tell me how if works?

#define naziv_datoteke 50 #include <stdio.h> #include "freeimage.h"   void freeimageerrorhandler(free_image_format fif, const char *message); fibitmap* genericloader(const char* lpszpathname, int flag);  int main(){     freeimage_initialise();     fibitmap *dib, *ptr;     char ulaz_slika[naziv_datoteke] = "bmp_24.bmp";     char izlaz_slika[naziv_datoteke] = "free.bmp";  //podrazumevana vrednost      dib = genericloader(ulaz_slika, 0);     //slika = freeimage_load(fif_bmp, "bmp_24.bmp", bmp_default);     freeimage_setoutputmessage(freeimageerrorhandler);     if (dib) {         printf("ucitan \"%s\".\n", ulaz_slika);     }      free_image_format fif = freeimage_getfiletype(ulaz_slika, 0);     if ((fif != fif_bmp) && (fif != fif_ico) && (fif != fif_jpeg) && (fif != fif_png) && (fif != fif_tiff)){         printf("format slike nije podrzan.\n");         return 1;     }       ptr = freeimage_convertto24bits(dib);     freeimage_setoutputmessage(freeimageerrorhandler);     freeimage_unload(dib);     freeimage_setoutputmessage(freeimageerrorhandler);     dib = ptr;     if (dib) {         printf("konvertovan u rgb.\n");     }       const char *slika = (const char*)freeimage_getbits(dib);       if (freeimage_save(fif, dib, izlaz_slika, bmp_default)) {         printf("snimljen \"%s\".\n", izlaz_slika);     }       if (dib) {         freeimage_unload(dib);     }     freeimage_deinitialise();     return 0; }  void freeimageerrorhandler(free_image_format fif, const char *message){     printf("\n*** ");     if(fif != fif_unknown) {         if (freeimage_getformatfromfif(fif))             printf("%s format\n", freeimage_getformatfromfif(fif));     }     printf(message);     printf(" ***\n"); }  fibitmap* genericloader(const char* lpszpathname, int flag) {     free_image_format fif = fif_unknown;     // check file signature , deduce format     // (the second argument not used freeimage)     fif = freeimage_getfiletype(lpszpathname, 0);     if(fif == fif_unknown) {         // no signature ?         // try guess file format file extension     fif = freeimage_getfiffromfilename(lpszpathname);     }     // check plugin has reading capabilities ...     if((fif != fif_unknown) && freeimage_fifsupportsreading(fif)) {         // ok, let's load file         fibitmap *dib = freeimage_load(fif, lpszpathname, flag);         // unless bad file format, done !         return dib;     }     return null; } 

no cannot. compile source, linker needs library.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -