大概原因就是libjasper把jas_martrix_get从宏定义改成一个内联函数了,所以会error.
解决方法是把grfmt_jpeg2000.cpp中的第380行改成
jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 );
把446行改成
jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 );
转自Building against the most recent libjasper 2.0.19 fails at grfmt_jpeg2000.cpp with "lvalue required as unary ‘&’ operand". · Issue #17984 · opencv/opencv · GitHub