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

标签 c++ mingw c++98

  1. 我不是程序员
  2. 我想在 win32 中编译 Inkscape,偶然发现了这些错误消息:

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

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

那么C++98标准是怎么写的呢?

我已经用谷歌搜索了,但没有人遇到过这种情况,这可能是无关的吗?

最佳答案

代替

const 矩阵矩阵 = { 比例因子,0, 0,比例因子, svgX, svgY };

应该是这样的:

常量矩阵矩阵( 比例因子,0, 0,比例因子, svgX, svgY );

关于c++ - 在 C++98 中初始化矩阵的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1833362/

相关文章:

android - 使用 ETEXT_DESC 在 Tesseract 中进行进度/取消回调

c++ - 默认的构造函数和析构函数是内联的吗?

c++ - 运行 SonarQube 分析扫描 - SonarSource build-wrapper

c++ - 关于在我的应用程序中实现 QThread 的问题?

c++ - 在 Windows 上使用 curlpp。如何开始

c++ - MinGW "undefined reference to IMG_Load/IMG_Init/IMG_Quit"LazyFoo

c++ - 使用 C++-98 的 Meyers Singleton 线程安全

c++ - 尝试随机播放 std::vector 时出错

c++ - 什么是段错误?我该如何解决?

c++ - 声明性区域的实际定义是什么