Question
Can't include raymath.h into my C++ raylib application
I am trying to include "raymath.h" into my C++ raylib project, but I can't seem to get it working, I'm getting a build error.
The way I'm trying to include raymath.h:
#include <iostream>
#include <string>
#include "raylib.h"
extern "C" {
#include "raymath.h"
}
And I'm getting the following error: raylib-master\src\raymath.h(2552,34): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
From what I could understand so far, is that on line 2552 of raymath.h:
float scalex = Vector3Length((Vector3){ a, b, c });
the code is not valid in C++ syntax, but in C.
I assume I am trying to include raymath.h wrong.
I have my project in Microsoft Visual Studio.
I have also tried including raymath without extern "C" {...}, just like raylib.h, but it did not work that way either.