Friday, July 31, 2009

Help with GD Library installation?

Hey, recently I started working with images and decided to install gd library so I could use it in my C++ apps. I am on windows xp professional and downloaded the files from here: http://www.boutell.com/gd/http/gdwin32.z... . I moved the header files into my include folder and copied all the others to the directory the compiler is in. It allows me to make a pointer to an image, but if I try something else I get an error. The code is:





#include %26lt;gd.h%26gt;





int main()





{


gdImagePtr im;


im = gdImageCreate(65, 70);


gdImageDestroy(im);





return 0;





}


and get these errors:





[Linker error] undefined reference to `_imp__gdImageCreate@8'


[Linker error] undefined reference to `_imp__gdImageDestroy@4'


ld returned 1 exit status





Can someone lead me in the right direction? I've read the documentation and would really like to get it working. Thanks for any help.

Help with GD Library installation?
You are going to have to search through the files that came with the gd library, and hope to find the functions/methods named _imp_gdimageCreate and _imp_gdimageDestroy


Upon finding, include the file in the compile commands, as the linker cannot find the appropriate function. ie,


%26lt;compiler/linker%26gt; %26lt;any_options%26gt; %26lt;your_files%26gt; %26lt;the_new_file_or_library%26gt;


No comments:

Post a Comment