daw42 / glslcookbook

Example code for the OpenGL Shading Language Cookbook - 2nd Edition (3rd Edition now available)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The problem when you compile as correct ??!

hays0503 opened this issue · comments

The problem when you compile as correct ??!

make -f Makefile
[ 1%] Building CXX object ingredients/CMakeFiles/ingredients.dir/vbotorus.cpp.o
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp: In member function ‘void VBOTorus::generateVerts(float_, float_, float_, unsigned int_, float, float)’:
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:80:21: error: ‘two_pi’ is not a member of ‘glm’
float ringFactor = glm::two_pi() / rings;
^
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:80:33: error: expected primary-expression before ‘float’
float ringFactor = glm::two_pi() / rings;
^
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:81:21: error: ‘two_pi’ is not a member of ‘glm’
float sideFactor = glm::two_pi() / sides;
^
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:81:33: error: expected primary-expression before ‘float’
float sideFactor = glm::two_pi() / sides;
^
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:98:20: error: ‘two_pi’ is not a member of ‘glm’
tex[tidx] = u / glm::two_pi();
^
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:98:32: error: expected primary-expression before ‘float’
tex[tidx] = u / glm::two_pi();
^
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:99:24: error: ‘two_pi’ is not a member of ‘glm’
tex[tidx + 1] = v / glm::two_pi();
^
/home/hays/program/glslcookbook-master/ingredients/vbotorus.cpp:99:36: error: expected primary-expression before ‘float’
tex[tidx + 1] = v / glm::two_pi();

commented

Please check that you have the latest version of the code. The glm::two_pi() statements should have the float parameter.

glm::two_pi<float>()

sudo apt-get install libglm-dev
because GLM has established a library
source code downloaded from GitHub today

commented

Your compiler error trace indicates that the <float> type parameter is missing. In the latest version of the code, it is there:

https://github.com/daw42/glslcookbook/blob/master/ingredients/vbotorus.cpp#L98