This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Linker error "multiple definition of 'Eigen::glRotate()' "

Tags: None
(comma "," separated)
Enzephalopat
Registered Member
Posts
3
Karma
0
Hi,

I want to use the unsupported/Eigen/OpenGLSupport module for the OpenGL bindings. Unfortunately, when I include the OpenGLSupport header in more than one object files, I get linker errors like

Code: Select all
temp/.objs/temp.o                                    In function Eigen::glRotate(Eigen::Rotation2D<float> const&)':|
include/eigen3/unsupported/Eigen/OpenGLSupport|192|  multiple definition of `Eigen::glRotate(Eigen::Rotation2D<float> const&)'|
temp/.objs/main.o:include/eigen3/unsupported/Eigen/OpenGLSupport|192|first defined here|


The minimal example is
main.cpp:
Code: Select all
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glu.h>

#include "temp.h"

int main()
{
   return 0;
}


temp.cpp:
Code: Select all
#ifndef TEMP_H
#define TEMP_H
#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glu.h>

#include <Eigen/Core>
#include <Eigen/OpenGLSupport>


#endif


temp.cpp
Code: Select all
#include "temp.h"


Is there any way to get around this?

Thanks in advance!
Enze
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
fixed in the default and 3.0 branches (some static keywords were missing)
Enzephalopat
Registered Member
Posts
3
Karma
0
Thanks for the quick reply. I am actually using Eigen 3.0, I'll try to download the very latest version and see if it's solved.

Cheers!
Enzephalopat
Registered Member
Posts
3
Karma
0
Thanks for the support! With the latest development branch it compiles and links perfectly.
Cheers,
Enzephalopat


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]