Xcode duplicate symbol error

后端 未结 5 440
轻奢々
轻奢々 2020-12-21 08:30

I am getting \"Apple Mach-O Linker (Id) Error\":

ld: duplicate symbol _matrixIdentity in /BlahBlah/Corridor.o and /Blahblah/Drawable.o for architecture i386
         


        
5条回答
  •  庸人自扰
    2020-12-21 09:14

    Two solutions to your problem:

    1. Declare only void matrixIdentity(mat4 m); in the header file and then implment the actual code in a corresponding c/m file.
    2. Make your function in the header file inline (that's the technique Apple uses)

      inline void matrixIdentity(mat4 m) { ...

提交回复
热议问题