Multiple game module files being created for some reason and causing errors, not sure if this is normal

Can someone please help me understand what’s going on here, if it’s normal, and if not, how to fix it?

I haven’t done anything out of the ordinary or changed any of these files or the funtion that’s giving me this error, but for some reason it’s saying it’s defined multiple times because multiple module files have been created. I went to the file path and don’t see those files in there.
image

Those module files are part of the unity build process that tries to speed up compilation times by collecting together cpp files into larger files and compiling that instead of compiling each cpp file individually. Those collections are reorganized dynamically as you add more files, check things out of source control and do other things with source files.

Where and how are you declaring and defining EItemTypeToString?

hi, thanks for the reply
the function is defined in a header file as part of a namespace, maybe there’s something i’m missing about namespace usage?

i’ve almost never used them before tbh so if that’s the problem then they’re not as simple as i thought. what confuses me is that it’s been like this during months of constant work and only now given me this issue

edit: just after sending this i realised the function should be static so i changed it and now it compiles…

You could also mark it inline, but the truest solution would be that you should have the body of that function in a cpp file and only the function declaration in the header. That way when you change that function you’re not causing every cpp file that uses it to be recompiled.

ah i see, thank you, i’ll do some more research on static and inline but for now i’ve gone with your suggestion of just defining in a cpp and that works well enough for now