2

I am developping a small 3D engine, using SDL2 to manage the window, and loading the models using Assimp.

When I compile my program, since I implemented Assimp, I have an "Ambiguous Symbol" error on the following integer types, linking to both sdl_stdinc.h and assimp/metadata.h

  • assimp/metadata.h:
    • int64_t
  • sdl_stdinc.h:
    • int8_t
    • int16_t
    • int32_t
    • int64_t
    • uint8_t
    • uint16_t
    • uint32_t
    • uint64_t

From what I understood, that this is a compatibility issue: Both Assimp and SDL2 are trying to redefine those types, but in the same namespace, so the compiler doesn't know which one to pick between the two.

Those two libraries are not included in the same files though... Could such thing have an impact on that error ?

And How can I solve it ? I found no solution over the Web whatsoever and I have the bad feeling that I'll have to change, for instance, SDL2 to GLFW to solve my problem.

Martin G
  • 17,357
  • 9
  • 82
  • 98
Remy San
  • 525
  • 1
  • 4
  • 24
  • Those are all Standard C types, so neither of those headers should be trying to define them. I'd suggest finding where in the header it tries to define those things and then adjusting your settings accordingly (hopefully the definitions are hidden behind portability macros). – M.M Nov 28 '14 at 00:33
  • C doesn't have "namespaces" – M.M Nov 28 '14 at 00:34

1 Answers1

0

You can include cstdint and put std::type for each ambiguous declaration:

#include <cstdint.h>

std::int8_t