The procedure entry point InterLockedCompareExchange@12 could not be located in the dynamic link library libfreetype-6.dll
The error message is a linker error. The linker combines your code with the code from the operating system, from the graphics libraries, from the audio libraries, and from everywhere else, and tells each of the parts about each other. It links the different parts of code together.
In this case the linker is looking for a function called InterLockedCompareExchange, and it is searching for it in a library called libfreetype-6
The function InterLockedCompareExchange is part of the Windows kernel. Your linker should be looking in kernel32, not libfreetype-6.
This is a linker problem, and a few moments in Google shows that MinGW is frequently misconfigured to not search the system libraries. Are you using the MinGW compiler?
Edit:
The function is usually implemented as a compiler intrinsic. It is very suspicious that your program would attempt to use the function version rather than the intrinsic version.
Longer description because this is For Beginners forum: A compiler intrinsic is when you write a function call but the compiler replaces it with in-place CPU instructions. One of many examples of intrinsic functions are math functions like sin() and cos(). The compiler could call the function for that, but calling a function requires setting a bunch of boilerplate code, setting up a stack frame, and then jumping to a new location, and cleaning up when it is done. When the intrinsic version of the function is used the compiler doesn't actually call a function. Instead it calls the CPU instruction directly which saves a lot of time and complexity. Since the compiler usually doesn't call the actual function the sin() and cos() functions are not really needed except in rare situations, and if you see them being linked it means something is probably wrong with the code.
The same is true with this intrinsic; the compiler probably should not be generating a function call for InterlockedCompareExchange. It is an atomic instruction on the platform and if the compiler isn't using the intrinsic then something is probably wrong with your settings.