NAS でのコンパイルエラー
Iwao@DS116:~/gcc_test/Test/gons_to$ g++ gons_to.cpp In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24:0, from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11, from gons_to.cpp:13: /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx: In function 'Xml_E GonsA_ToDAE(const GonsA&, c_v_tstring&)': /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:180:95: error: invalid initialization of non-const reference of type 'Vd3& {aka Vector3<double>&}' from an rvalue of type 'Vd3 {aka Vector3<double>}' Xml_E nodeR = dae_out::node_lookat(ID_visual_scene_n_c_R,ID_camera_R_STD,stdR.GetEyePoint(),target) ; ~~~~~~~~~~~~~~~~^~ In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:12:0, from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24, from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11, from gons_to.cpp:13: /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/fe_dae.hxx:596:15: note: initializing argument 3 of 'static Xml_E dae_out::node_lookat(LPCTSTR, LPCTSTR, Vd3&, Vd3&)' static Xml_E node_lookat ( ^~~~~~~~~~~ In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24:0, from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11, from gons_to.cpp:13: /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:181:95: error: invalid initialization of non-const reference of type 'Vd3& {aka Vector3<double>&}' from an rvalue of type 'Vd3 {aka Vector3<double>}' Xml_E nodeL = dae_out::node_lookat(ID_visual_scene_n_c_L,ID_camera_L_STD,stdL.GetEyePoint(),target) ; ~~~~~~~~~~~~~~~~^~ In file included from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/ga_dae.hxx:12:0, from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/gonsa_to.hxx:24, from /volume1/public/C_Sync/GoogleD/Develop/_.SRC/Test/gons_to.hpp:11, from gons_to.cpp:13: /volume1/public/C_Sync/GoogleD/Develop/_.SRC/__Iwao/fe_dae.hxx:596:15: note: initializing argument 3 of 'static Xml_E dae_out::node_lookat(LPCTSTR, LPCTSTR, Vd3&, Vd3&)' static Xml_E node_lookat ( ^~~~~~~~~~~ Iwao@DS116:~/gcc_test/Test/gons_to$ g++ gons_to.cpp Iwao@DS116:~/gcc_test/Test/gons_to$ ./a.out
node_lookat の 3 つ目の Vd3& を const とすることで対応.
“invalid initialization of non-const reference of type” で検索するとわかりやすく書いてあった.