GFL with DevC++

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

Post Reply
Luk

GFL with DevC++

Post by Luk »

It's possible to use GFL libraries with DevC++ (mingw compiler) ???? If it's , how to do this ?
Thnks
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: GFL with DevC++

Post by xnview »

Luk wrote:It's possible to use GFL libraries with DevC++ (mingw compiler) ???? If it's , how to do this ?
You can use GFL librairies by dynamic loading. Use LoadLibrary/GetProcAdress
Pierre.
User avatar
Ithier
Posts: 47
Joined: Fri Nov 19, 2004 10:50 am
Location: Paris, France
Contact:

Post by Ithier »

It is even easier. First you have to modify the header files (libgfl.h and libgfle.h), replace the folowing lines

Code: Select all

#ifdef WIN32
	#ifdef __BORLANDC__
		#pragma option -a8  /* switch to 8-bytes alignment */
	#else
		#pragma pack (push, before_push)
		#pragma pack (8)
	#endif
#else
#endif
by

Code: Select all

#ifdef WIN32
    #if defined (__BORLANDC__)
        #pragma option -a8  /* switch to 8-bytes alignment */
    #elif defined (__MINGW32__)
        #pragma pack (push, before_push, 8)
    #else
        #pragma pack (push, before_push)
        #pragma pack (8)
    #endif
#else
#endif
Then you have to create .a files. To do that use the reimp tool (in your dev-cpp\bin directory) on the .lib provided (ex: reimp libgfl.lib).
Then copy the .a in the dev-cpp\lib directory.
Now you can use the library as other libraries and call the functions as normal functions.
Post Reply