-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[build] Issue And Solution : RayLib 2.5 programs doesn't compile on windows (Visual Studio 2017) #896
Comments
Note : This issue happens when the source code uses windows.h #include <windows.h> I solved the problem by excluding the code that need windows.h from RingRayLib extension Thanks! |
This issue has been raised multiple times before, last time in #857, which describes a workaround for using both WinAPI and raylib in the same translation unit.
From that issue:
As it seems you are fine with using separate translation units, I'll mark the issue closed. Feel free to open new ones whenever issues pop up! |
Hello
RayLib is a nice library, It's powerful and simple, I decided to integrate it with the Ring programming language (http://ring-lang.net - To be distributed with the language as one of the standard libraries)
I tried to use the RayLib 2.5 (binary release) for Microsoft Windows, using Visual Studio 2017 (Command Prompt), but I get the next Syntax Errors !
Solution
Update raylib.h file
(1) Change typedef struct Rectangle to typedef struct RayRectangle (And update all related functions to use the new name)
(2) Change function CloseWindow to RayCloseWindow
(3) Change function ShowCursor to RayShowCursor
(4) Change function LoadImageA to RayLoadImageA
(5) Change function DrawTextEx to RayDrawTextEx
(6) Change function DrawText to RayDrawText
Changing function names in the header files only is a Workaround, This update must be done at the library source code (*.c file) itself.
Idea : In next versions of RayLib, start all of the function names with something like ray_ to avoid conflict in function names.
Greetings,
Mahmoud
The text was updated successfully, but these errors were encountered: