OpenPHDGuiding / phd2

PHD2 Guiding
https://openphdguiding.org
BSD 3-Clause "New" or "Revised" License
245 stars 111 forks source link

Compilation error after change 7620d8f8dd9a19222e5c07d622b7a0682f61cb65 #1083

Closed pchev closed 1 year ago

pchev commented 1 year ago

After change 7620d8f8dd9a19222e5c07d622b7a0682f61cb65 PHD2 no more compile on Linux :

/home/pch/source/phd2/phd2/star_profile.cpp: In member function ‘void ProfileWindow::OnPaint(wxPaintEvent&)’: /home/pch/source/phd2/phd2/star_profile.cpp:323:29: error: cannot bind non-const lvalue reference of type ‘wxBitmap&’ to an rvalue of type ‘wxBitmap’ 323 | tmpMdc.SelectObject(wxBitmap(subDImg.Rescale(width, width, resizeQuality))); | ^~~~~~~~~~~~~~ In file included from /usr/include/wx-3.2/wx/wx.h:53, from /home/pch/source/phd2/phd2/phd.h:47, from /home/pch/source/phd2/phd2/star_profile.cpp:36: /usr/include/wx-3.2/wx/dcmemory.h:29:33: note: initializing argument 1 of ‘void wxMemoryDC::SelectObject(wxBitmap&)’ 29 | void SelectObject(wxBitmap& bmp); | ~~^~~

It compile and work after replacing star_profile.cpp line 323 by:

    wxBitmap wxbmp = wxBitmap(subDImg.Rescale(width, width, resizeQuality));
    tmpMdc.SelectObject(wxbmp);

I am not sure this is the best fix, so not make a PR.

Patrick

agalasso commented 1 year ago

fixed by #1084