compile error: duplicate explicit instantiation

Questions, problems and discussion about compiling FreeOrion.
Post Reply
Message
Author
Nexus
Space Floater
Posts: 47
Joined: Fri Aug 14, 2015 8:29 pm

compile error: duplicate explicit instantiation

#1 Post by Nexus » Thu Sep 17, 2015 7:21 pm

Tried to compile latest (560e642a57) version on Linux Mint 17.2, 64 bit. I got this error:

Code: Select all

GLClientAndServerBuffer.cpp:201:16: error: duplicate explicit instantiation of ‘class GG::GLClientAndServerBufferBase<float>’ [-fpermissive]
 template class GLClientAndServerBufferBase<float>;

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12284
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: compile error: duplicate explicit instantiation

#2 Post by Geoff the Medio » Thu Sep 17, 2015 7:35 pm

should be fixed

Nexus
Space Floater
Posts: 47
Joined: Fri Aug 14, 2015 8:29 pm

Re: compile error: duplicate explicit instantiation

#3 Post by Nexus » Thu Sep 17, 2015 8:01 pm

Wow, that was quick! You don't mess around, do you? That problem seems to be fixed, but I am now getting

Code: Select all

MapWnd.cpp.o: In function `MapWnd::RenderStarfields()':
MapWnd.cpp:(.text+0x4884): undefined reference to `RandGaussian(double, double)'
MapWnd.cpp:(.text+0x48a2): undefined reference to `RandGaussian(double, double)'

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12284
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: compile error: duplicate explicit instantiation

#4 Post by Geoff the Medio » Thu Sep 17, 2015 8:36 pm

Try adding

Code: Select all

#include "../util/Random.h"
near the top, amongst the other includes.

Edit: nevermind, it's already there.

Edit2: Try adding "FO_COMMON_API " before the declaration of RandGaussian in Random.h (at the bottom).

Nexus
Space Floater
Posts: 47
Joined: Fri Aug 14, 2015 8:29 pm

Re: compile error: duplicate explicit instantiation

#5 Post by Nexus » Thu Sep 17, 2015 9:23 pm

Success. :)

Post Reply