Merge doesn't compile with C++

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

Moderators: XnTriq, xnview

romu

Merge doesn't compile with C++

Post by romu »

gflMerge works correctly with a C project, but I have to use C++, and the error occured:

Code: Select all

GFL_LOAD_PARAMS load_option; 
	GFL_FILE_INFORMATION file_info; 
	GFL_ERROR error; 
	GFL_BITMAP * bitmap_table[4], * new_bitmap; 
	GFL_INT32 opacity[4] = { 40, 25, 15, 20 }; 
	GFL_POINT points[4] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; 
	GFL_SAVE_PARAMS save_option; 
	GFL_INT32 i; 

	for ( i=0; i<4; i++ )
	{
		gflGetDefaultLoadParams( &load_option ); 
		error = gflLoadBitmap( filename[i], &bitmap_table[i], &load_option, &file_info ); 
		if ( error )
		{
			DisplayError( filename[i], error ); 
			return; 
		}
	}
error = gflMerge( bitmap_table, points, opacity, 4, &new_bitmap ); 
the error is:

Code: Select all

error C2664: 'gflMerge' : cannot convert parameter 1 from 'GFL_BITMAP *[4]' to 'const GFL_BITMAP *[]'
any idea on how to proceed?
User avatar
xnview
Author of XnView
Posts: 36412
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Merge doesn't compile with C++

Post by xnview »

romu wrote: the error is:

Code: Select all

error C2664: 'gflMerge' : cannot convert parameter 1 from 'GFL_BITMAP *[4]' to 'const GFL_BITMAP *[]'
any idea on how to proceed?
If you use:

Code: Select all

error = gflMerge( (GFL_BITMAP *[])bitmap_table, points, opacity, 4, &new_bitmap );