Problem compiling Magick++ based app, altimage.h

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Bob-O-Rama
Posts: 31
Joined: 2007-11-23T15:34:51-07:00

Problem compiling Magick++ based app, altimage.h

Post by Bob-O-Rama »

Hi,

I have an existing project using Magick++, which I have rebuilt for various prior releases of ImageMagick. But on trying to rebuild it for 6.7.1, on VC 2005, I am able to build the 6.7.1 source for shared library ( x86, multi-threaded, 32-bit ) and the build seems successful. On pointing my project at the new 6.71 headers and libraries, cleaning the project, I get build errors which point at Microsoft's altimage.h
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(207) : warning C4002: too many actual parameters for macro 'SetPixelRGB'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(207) : error C2059: syntax error : '{'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(207) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(207) : error C2059: syntax error : 'throw'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(207) : error C2238: unexpected token(s) preceding ';'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : warning C4002: too many actual parameters for macro 'SetPixelRGB'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : error C2589: '{' : illegal token on right side of '::'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : warning C4091: 'inline ' : ignored on left of 'void' when no variable is declared
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : error C2143: syntax error : missing ';' before '::'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : error C2059: syntax error : '::'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : error C2143: syntax error : missing ';' before '{'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : error C2447: '{' : missing function header (old-style formal list?)
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1424) : error C2059: syntax error : 'throw'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1425) : error C2143: syntax error : missing ';' before '{'
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlimage.h(1425) : error C2447: '{' : missing function header (old-style formal list?)
This occurs for any of my sources where I include Magick++

The code in Microsoft's altimage.h referenced is:

Code: Select all

	void SetPixelRGB( int x, int y, BYTE r, BYTE g, BYTE b ) throw();

Code: Select all

inline void CImage::SetPixelRGB( int x, int y, BYTE r, BYTE g, BYTE b ) throw()

{

	SetPixel( x, y, RGB( r, g, b ) );

}
Any idea what this is? I have not back tracked version-wise to see when this started, but I was previously on 6.5.2 and this problem does not occur.

Thanks!

-- Bob
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem compiling Magick++ based app, altimage.h

Post by magick »

It looks like standard C namespace pollution. We'll fix the problem in the next point release of ImageMagick. Thanks.
Bob-O-Rama
Posts: 31
Joined: 2007-11-23T15:34:51-07:00

Re: Problem compiling Magick++ based app, altimage.h

Post by Bob-O-Rama »

Hi,

Is there anything I can do to work around this meanwhile? If not, then a follow-up question: :-)

What is pushing me to the new release is that I am having a problem with rotate() on 6.5.4. I made some trivial change elsewhere in the app, for example just adding a dummy class which uses the Magick++ libraries anywhere to the project, and then rotate() started generating huge ( 371MB ) pixel cache swap files. During "normal" operation, rotate() on a 10MP image, would allocate about 60MB for the pixel cache ( I'm using the 16-bit libraries ). In tracing the code, I can see rotate leading to allocating a 371MB allocation, which fails, then it creates the swap file. It seems to make a 371MB swap no-matter the original size of the image rotated. On Googling and checking the forums it appears where were some issues with rotateI() so my hope was that 6.7.x would fix that.

"Anyway, thanks for listening." :-) You guys rock.

-- Bob
Post Reply