Clang redifines functions

If I try to compile I get an error massage telling me that function max is redefined, the code looks like this:

#pragma once
#include "JuceHeader.h"

double max(double valueA, double valueB) {
    return (valueA > valueB) ? valueA : valueB;
}

How is it possible that max get’s redefined, even-though pragma once is used?

I have not used juceheader.h directly since moving to cmake, but it suspect this is a clash with the standard library. See std::max - cppreference.com

This was my first thought as well, so I renamed max to “ajdjah” (which I’m pretty sure is not existing as function :P), still the same error.

Is it possible that you get a linker error rather than a compiler error? The file above looks like a header file, if you include it in multiple translation units, there are multiple definitions of the function in the program. Usually, you declare such functions as inline to make that work

Ah year was a linker error, I probably should have wrote that clearer.

Year with inline it worked.