Was ist der richtige Weg, um eine Matrix in C ++ 98 zu initialisieren?
Frage
- Ich bin nicht Programmierer
- Ich will Inkscape in win32 kompilieren, und stolperte auf diesen Fehlermeldungen:
ui / dialog / filedialogimpl-win32.cpp: 1379: Fehler: in C ++ 98 'Matrix' muss vom Konstruktor initialisiert wird, nicht durch '{...}'
make [1]: *** [ui / dialog / filedialogimpl-win32.o] Fehler 1
Der mutmaßliche Code von 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); ...
Also, wie ist es in C ++ 98-Standard geschrieben?
Ich habe googeln es aber niemand begegnet, dass die Art und Weise, könnte es in keinem Zusammenhang sein?
Lösung
Anstelle von
const Matrix matrix = {
scaleFactor, 0,
0, scaleFactor,
svgX, svgY };
Es sollte wie folgt sein:
const Matrix matrix(
scaleFactor, 0,
0, scaleFactor,
svgX, svgY );
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow