Theverat / NormalmapGenerator

A simple program that converts images into normal maps
GNU General Public License v3.0
416 stars 51 forks source link

compilation error #24

Closed florianfelix closed 7 years ago

florianfelix commented 7 years ago

Hi i tried building on manjaro (arch) linux but got errors. I did qmake NormalmapGenerator.pro; make; wit this errors:

src_viewer/camera.cpp: In constructor ‘Camera::Camera()’: src_viewer/camera.cpp:5:14: error: ‘M_PI’ was not declared in this scope xAngle = M_PI / 4.0; ^~~~ src_viewer/camera.cpp: In member function ‘void Camera::rotateY(float)’: src_viewer/camera.cpp:19:27: error: ‘fabs’ was not declared in this scope if(fabs(yAngle + angle) < M_PI / 2.0) ^ src_viewer/camera.cpp:19:31: error: ‘M_PI’ was not declared in this scope if(fabs(yAngle + angle) < M_PI / 2.0) ^~~~ src_viewer/camera.cpp: In member function ‘const QMatrix4x4& Camera::toMatrix()’: src_viewer/camera.cpp:42:49: error: ‘sin’ was not declared in this scope position = QVector3D(radius * sin(xAngle) * cos(yAngle), ^ src_viewer/camera.cpp:42:63: error: ‘cos’ was not declared in this scope position = QVector3D(radius * sin(xAngle) * cos(yAngle), ^ make: *** [Makefile:632: camera.o] Error 1

Theverat commented 7 years ago

Reminds me of issue #19. Try to add include <cmath> to the file camera.cpp. If this helps I'll commit it.

florianfelix commented 7 years ago

That fixed it. thx.