user2784724
user2784724

Reputation: 11

OpenGL Image (GLI) : one or more multiply defined symbols found

I'm trying to set up a class that uses GLI but I can't get the library to work even with simple code.

-----------------------------------------------------------------------
                                 header.hpp
-----------------------------------------------------------------------
#pragma once

#include "gli\gli.hpp"

-----------------------------------------------------------------------
                                 source.cpp
-----------------------------------------------------------------------
#include "header.hpp"

-----------------------------------------------------------------------
                                 main.cpp
-----------------------------------------------------------------------
#include "header.hpp"

int main(int argc, char* argv[])
{
    return 0;
}

I never had a problem like this before but it seems like I can't include a header that includes the library itself in my main.cpp when it's already included in another .cpp file. I can include the library directly in my source.cpp instead of my header.hpp but I don't think it would be a great solution.

The Visual-Studio build output says :

fatal error lnk1169 one or more multiply defined symbols found

Upvotes: 1

Views: 788

Answers (1)

Sean Harmer
Sean Harmer

Reputation: 86

See this bug https://github.com/g-truc/gli/issues/27. Solution is to mark the view ctor and assignment operators as inline.

Upvotes: 1

Related Questions