Tutorial :What is the correct way to initialize a Matrix in C++98?



Question:

  1. I'm not programmer
  2. I want to compile Inkscape in win32, and stumbled on these error messages:

ui/dialog/filedialogimpl-win32.cpp:1379: error: in C++98 'matrix' must be initialized by constructor, not by '{...}'
make[1]: *** [ui/dialog/filedialogimpl-win32.o] Error 1

The suspected code of filedialogimpl-win32.cpp:

  ...      // Draw the image      if(_preview_bitmap_image)    // Is the image a pixbuf?      {          // Set the transformation          const Matrix matrix = {              scaleFactor, 0,              0, scaleFactor,              svgX, svgY };          context->set_matrix (matrix);  ...  

So how is it written in C++98 standard?

I've googling it but no one encountered that way, could it be unrelated?


Solution:1

Instead of

const Matrix matrix = { scaleFactor, 0, 0, scaleFactor, svgX, svgY };

there should be something like this:

const Matrix matrix( scaleFactor, 0, 0, scaleFactor, svgX, svgY );


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »