Skip to content

Can't compile using GLM 0.9.8 with gcc 4.8 and c++11 on Ubuntu 16.04LTS #550

@mean-ui-thread

Description

@mean-ui-thread

The problem

I'm on Ubuntu 16.04LTS. I am required to build my product using gcc 4.8 (instead of default gcc 5.4) for binary compatibility reasons with older versions of Ubuntu.

To reproduce the problem, you will need to install gcc-4.8 on Ubuntu 16.04LTS:

sudo apt-get install gcc-4.8 g++-4.8

Then get my test source code:

Test.cpp.zip

Assuming that GLM is cloned in git/glm-0.9.8, and checked-out on the 0.9.8 release tag, compile my test source code this way, using g++4.8 :

/usr/bin/g++-4.8 -Igit/glm-0.9.8 -std=c++11 -o Test.o -c Test.cpp

This will generate the following error:

glm/glm/detail/type_vec4_simd.inl:446: error: redeclaration ‘constexpr glm::tvec4<T, P>::tvec4(A, B, C, D) [with A = int; B = int; C = int; D = int; T = int; glm::precision P = (glm::precision)5u]’ differs in ‘constexpr’
  GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
                                                                                                            ^

Work-around

So far, I have 3 options:

  1. Downgrade to glm 0.9.7
  2. Downgrade Ubuntu to 14.04LTS
  3. Downgrade all my code to c++03 standard (-std=c++03)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions