GillesDebunne / libQGLViewer

libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers.
Other
241 stars 94 forks source link

Compile with warning as error #74

Open fghoussen opened 1 year ago

fghoussen commented 1 year ago

Compile with warning as error.

Note: gave up on Qt deprecated declarations for a start...

fghoussen commented 1 year ago

https://github.com/GillesDebunne/libQGLViewer/issues/75#issue-1819831100: seems there are cross dependencies between NVector3 and Vector3: they both need each other.

@GillesDebunne: cross dependency should be broken, not sure what is better as I don't know how code was designed. My understanding is that NVector3 is just for having normalized vector so removing NVector3 but adding a bool normalized member in Vector3 could break the cross dependency (?) and allow easy define/implementation/link with all kind of operators (which will then need to be defined only once)

/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator*(vrender::Vector3 const&, vrender::NVector3 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator<<(std::ostream&, vrender::Vector3 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator-(vrender::Vector2 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator*(double, vrender::Vector3 const&)'
/usr/bin/ld: libQGLViewer.so: undefined reference to `vrender::operator*(vrender::NVector3 const&, vrender::Vector3 const&)'
collect2: error: ld returned 1 exit status
fghoussen commented 1 year ago

The last warnings are Qt deprecation which fix may depend on version Qt5/6... Would be good to get rid of -Wno-error=deprecated-declarations.