简体   繁体   English

在C ++ 98中初始化矩阵的正确方法是什么?

[英]What is the correct way to initialize a Matrix in C++98?

  1. I'm not programmer 我不是程序员
  2. I want to compile Inkscape in win32, and stumbled on these error messages: 我想在win32中编译Inkscape,偶然发现了以下错误消息:

ui/dialog/filedialogimpl-win32.cpp:1379: error: in C++98 'matrix' must be initialized by constructor, not by '{...}' ui / dialog / filedialogimpl-win32.cpp:1379:错误:在C ++ 98中,“矩阵”必须由构造函数而不是“ {...}”初始化
make[1]: *** [ui/dialog/filedialogimpl-win32.o] Error 1 make [1]:*** [ui / dialog / filedialogimpl-win32.o]错误1

The suspected code of filedialogimpl-win32.cpp : 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? 那么,它是如何用C ++ 98标准编写的呢?

I've googling it but no one encountered that way, could it be unrelated? 我已经搜寻了它,但没有人遇到过这种情况,这可能无关吗?

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 );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM