Thank you for this walkthrough! I'm very new to C, but with your help I've got my first .exe! I had issues compiling Raylib previously because I used the wrong version of mingw. But your instructions worked perfectly once I got rid of the artifacts from the 'wrong' compiler (the .o files). Thanks again!
Only by watching this video I was finally able to run my first raylib exe. THANK YOU SO MUCH! One question though: Is it possible to surpress the popping up of the shell with all the info text showing up...?
pretty much a masterclass in how to make one of these installation tutorials clear instructions throughout; no lame attempts at humour or silly music many thanks for sharing your knowledge stoked to get this up and running; looking forward to see what i can do with it one question: do we really need the -I include/ part of our instruction to the compiler? doesn't the compiler already know where to find raylib.h given that we've hard coded that into our source file? thanks again; much appreciated
#include "somefile.whatever" is literally a cut+paste operation. That is all you need for compiling your code. But that include never gets to the linker as it is consumed by the pre-processor. ( You can stop reading here. That is the answer. Below is more detail. ) Compiling doesn't create an executable, it creates "compilation units". A lot of time, with a dead simple C program where you have zero external dependencies, you have only 1 compilation unit. Which is why I think sometimes people get lazy and say "compile your program" when they really mean "build your program". Where "build" means "compile and link". Since you are using "raylib" functions, when you link together your compilation unit with the raylib compilation unit (raylib.a) , the linker needs a way to cross check the raylib functions you are calling and be all like "Do these functions really exist in raylib.a ?" Technically a ".a" file is not a compilation unit, but a collection of compilation units. Whereas a ".o" file is a single compilation unit. Hopefully I got all that correct. Here is some of the stuff I looked at on stack overflow while answering. As my understanding of compiling and linking is pretty rudimentary myself. stackoverflow.com/questions/59251013/ stackoverflow.com/questions/18548157/ stackoverflow.com/questions/654713/
liked and subbed, first time(due to bad version of mingw I think wich I realised too late(a good 1 year while I was doing only terminal based programs)) I achieved downloading a graphics library THANK YOU!
@@kirubelalemayehu10c67 nope, it didn't. I just decided to manually type in the g++ (i'm using c++ so I used g++ for the terminal) everytime It can work if you tinker with the powershell security though, but uhhhhhhh I don't wanna and I'm not privy enough on how to do that
All is well except when I go to download the mingw64 bit, it only gives a zip file, no installation wizard at all. What do I do? I was running on mingw32, but since apparently raylib is not compatible with that, I must install mingw64, which is giving me trouble. It's things like this that steer me away from programming. I suppose it's just a stumbling block I must get over if I want to succeed with programming. But jeeze... I've been spending hours just trying to get my IDE to be able to detect this library without any errors. What am I supposed to do when I go to the same link you went to to get mingw64, and it just gives me a zip file with a bunch of other files in it, no installation wizard. It's upsetting because I am a novice programmer, and It feels like little things like this go over so smoothly with others, and here I am spending hours just trying to successfully build it. Sigh. I just want to make an algorithm visualizer in c++.
How do I do it with cmake? I opened command prompt in src folder and typed "cmake .." This should've given me a dll file (instead of .a file), but I got include errors. Basically cmake can't find files it needs to include from raylib/cmake, although that directory is present with all the files
@@rudyfaile I'm probably too new at all this but I've gone through nearly every example on the site. I love the way it looks and I'm ready to take a deep dive but I'm having trouble understanding how to combine the examples in a sensible way. Like how could a first timer make the transition from tinkering with examples to integrating multiple examples together? Like an opening menu that can transition you onto a play field.
I'm getting this too for version 4.5. Anyone know what the issue is? At this point I've just downloaded the source from the same location, just a more recent version, so I have no idea why it would be throwing errors since there's literally no other changes on my part.
Was getting an error building one of the example projects: "skipping incompatible" Solution was to run "mingw32-make clean" in raylib's src directory, then rebuild raylib. Replacing the raylib files I was using in the example project fixed the problem.
This changes nothing about the video, but if you want to know more or found the mixing of MinGW and GCC confusing, this is for you: MinGW isn’t a compiler. GCC (GNU Compiler Collection) is the compiler and it’s included with MinGW. What is MinGW then? It’s a minimal set of tools and libraries common across GNU-based OSs, but tailored for Windows applications. Minimalist Gnu for Windows = MinGW. It gives you the development environment you have on GNU + Linux, but allows you to create native Windows applications on Windows as well as on GNU + Linux.
Great explanation! For what it's worth, I was aware of this when I created the video (and I think I kind of mention it when I discuss gcc and compilers in general) but didn't want to confuse beginners too much by getting too deep in the woods with the nuances of development on windows. Thanks for your clarifying comment!
Hi, i followed this turorial but i want to code in c++. I enter the command and it says "-std=c99" is valid for C/ObjC but not for C++. Any ideas how i could? Without having to reinstall everything?
My guess is your Mingw/gcc installation is missing C. My reasoning: When I install gcc I intentionally remove all C++ stuff so I never accidentally compile "C++" code. Possibly you intentionally did not install "C" so you wouldn't accidentally compile "C" code as you are a "C++" dev?
how could i do if i wanted to move all the .c file in a src file and then compile? if i try it says it can't find raylib, even if i change the command line or the include/raylib in just raylib
Is it similar if I do this for c++? The only difference i know of is using g++ instead of gcc and not using std -c99 i guess. Please let me know if there are any other changes i gotta do.🙏🙏
I had this setup on my previous PC, but now it doesn't work anymore. I am not using Visual Studio Code, but Visual Studio Community 2022, and I am not sure which paths to add or where... It can find the header file for raylib, but then the linker complains that there are unresolved external symbols for all the built in things such as "InitWindow" etc.
Great tutorial bro, just sad I cant use it since I got an error around 5:45. I've been trying to redo it for like 5 times now reinstalling everything but to no avail. Good tutorial nonetheless cheers bro
What do you do if you have Cyngus/Cynwin? installing MinGW doesn't work for my system I keep getting a download did not install correctly. What do you do if you have Cyngus/Cynwin are there any -make commands for Cyngus and if there is where do I find them?
I cant seem to get the installer to work ( for mingw) , would you happen to have any idea why? It says "The file has been downloaded incorrectly!" I have tried reinstalling the program.
When compiling the basic window I'm receiving an error that it skips the incompatible lib//libraylib.a looking for -lraylib I've also tried changing the "-L lib/" to "-L lib" and that gives me the same error just skipping lib/libraylib.a. I didn't have a problem compiling raylib. Does anyone know what might be causing this? The full error: C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib//libraylib.a when searching for -lraylib C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib/\libraylib.a when searching for -lraylib C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib//libraylib.a when searching for -lraylib C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lraylib
So if anyone is running into this issue I found a fix. When I compiled raylib the first time I used GitBash since that is the terminal I prefer, however when I recompiled raylib in powershell the new libraylib.a seems to work. I'm not sure why compiling in powershell instead of gitbash fixes the issue. If anyone knows why this happens I would love to know.
@@mmaaauuuuiiiii Thanks! I used command prompt and I had the same issue. Used powershell instead and it worked. I would also love to know why this happened.
in the compile command i got en error saying "cc1.exe: error: argument to '-O' should be a non-negative integer, 'g', 's', or 'fast' im completely lost can i get some help?
I'm new to C and it was pretty much exactly what I needed thank you ! Quick question for anyone though : where do the flags "-lopengl32 -lgdi32 -lwinmm" come from ? Where do you find which libs the compilation needs (apart from libraylib.a of course) ? It doesn't seem, to me, that any kind of documentation mentions them, but of course it's not true, I just can't find it :/
9 months late but, winmm and gdi32 are libraries every windows system has, they will be available on 100% of windows machines (unless you messed up some configuration), opengl32 is usually externally downloaded, but raylib packages it's own openGL, basically when you compile raylib you also compile a openGL, windows libraries end with .a, those are linkable, .dlls have to be loaded at runtime and they need to be in the same folder as the .exe you compiled.
it works really well but where is the documentation especially for -I include/ -L lib/ -lraylib -lopengl32 -lgdi32 -lwinmm. this command really helpfull than setting in ide
I am getting: lib//libraylib.a(core.o):core.c:(.text+0x1638): undefined reference to `__mingw_realloc' lib//libraylib.a(core.o):core.c:(.text+0x705a): undefined reference to `__mingw_free' ... collect2.exe: error: ld returned 1 exit status Do you have any idea?
@@alan5506 fixed it a while ago by recompiling the source code from the command prompt. I don't know what the problem was but recompiling might just fix it.
I am wondering if you would do a tutorial for getting it to work in Code::blocks which is my IDE of choice. I am going to have a go doing it the way you said, but then I am going to try and get it to work in Code::blocks, but I will probably mess up LOL.
@@thespontaneoustomato2676 Hey man, When I tried setting up Raylib C# in VS2019 it didn't work, but I tried it in VSCode and it worked :D Open up the terminal, type "dotnet new console" then after that is setup type "dotnet add package Raylib-cs --version 3.7.0" and then to run it, type "dotnet run"
@@rudyfaile Good Question :D, Maybe something along the lines of basic physics simulation? Maybe simple use of tiles and sprites? There is loads of documentation on raylib so it doesn't matter if you don't have the time or weren't planning on doing a follow up - it is a great video on its own. Would be nice though :D. Really enjoyed the video.
No😭 One day I had raylib working without inlcuding the lib/include folders. It was just #include But I don't know to do it anymore, I added the lib/include to my windows variable PATH, but it isnt working😭
type this in terminal and hit enter it should work fine gcc -o main.exe main.c C: aylib aylib\src aylib.rc.data -s -O2 -IC: aylib aylib\src -LC: aylib aylib\src -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99 -Wall -mwindows no need to add any sort of file or folder just make sure raylib is installed in default directory (i.e C:/raylib) and copy paste basic_core_window.c to main.c
@@Ashwin_1198 Never thought I would get a reaction. I chabged c++ built in library and added raylib there. But thanks for this command, should come in handy🤌🏻🫶🏻
I hope you're still active because I need some help. I'd like to have a src folder with all the code to make it a bit clearer. If I run the build commands for the compiler from the src folder, it says it can't find raylib.h. Is there a change I'd have to do to make it possible for this to work. I can get it to build if I run the commands from the main dir, and just reference the main.c in the build commands with gcc src/main.c etc. but this would cause problems with the stuff the source code references no longer matching its relative file path. Is there a way I could slightly modify the gcc build commands so that it works from within c. Also thanks for the video.
If you mean you have it setup like: [some-project-folder] | |-----[include] | |-----------raylib.h | |-----[lib] | |----------libraylib.a | |-----[src] |-----------main.c And you want to run the compiler command from the "src" directory. It's looking for "include" and "lib" in the "src" directory when they are in the parent directory. Changing: -I include/ -L lib/ to -I ../include/ -L ../lib/ So it looks for those directories in the parent directory should suffice. (edit: removed unnecessary tip)
No - you'd probably want to look into the IDE's instructions.... looks like others have had success: github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)#building-with-clioncmakeemscripten-for-web
This is almost always because .dll files are missing & need to be placed in the same directory as the executable. Sorry you didn't get a timely reply, hopefully this can be useful to you or someone else reading
Perdón que te moleste, pero al compilar como en el video, no incluye las librerias extras de Raylib, cierto? Cómo hay que indicar que queremos incluirlas en la compilación sino? Mi idea es tener todas las librerias extras incluidas también.
U SAY TO GET THE 64 BIT VERSION THEN U INSTALL AN .EXE THAT HAS BOTH 64 AND 32BIT. THEN U CHANGE ARCHITECTURE TO 64...BUT THEN U CHANGE IT BACK TO 32 AND TELL US TO MAKE SURE ITS THE 32BIT VERSION????? WTFFF????
Awesome tutorial, however I am getting an error when I try to build it: *lib//libraylib.a(rglfw.o):rglfw.c:(.text+0x37fb): undefined reference to `__ms_vsnprintf'* Does anyone know what might be causing it and how I could fix it?
This is by far the best tutorial out there on how to compile raylib and build a project in it. Thank you for doing this.
Thank you! 🙇♂️
The best explanation I found so far explaining how to actually compile the library.
Thank you for this walkthrough! I'm very new to C, but with your help I've got my first .exe!
I had issues compiling Raylib previously because I used the wrong version of mingw. But your instructions worked perfectly once I got rid of the artifacts from the 'wrong' compiler (the .o files).
Thanks again!
Also, thank you for explaining the compiler commands and showing us how to set all of this up without a bulky IDE.
Outstanding presentation, clearly spoken, to the point, quick summaries. Thank you for the save.
Thanks!
Awesome stuff, man! And thanks for the shoutout!
Only by watching this video I was finally able to run my first raylib exe. THANK YOU SO MUCH! One question though: Is it possible to surpress the popping up of the shell with all the info text showing up...?
Found sollution myself: Run gcc compiler with option -mwindows.
Thank you so much! Its a very short video but yet so easily understandable. Its the only turtorial that worked for me.
Thank you for this. Exactly what I was looking for!
pretty much a masterclass in how to make one of these installation tutorials
clear instructions throughout; no lame attempts at humour or silly music
many thanks for sharing your knowledge
stoked to get this up and running; looking forward to see what i can do with it
one question: do we really need the -I include/ part of our instruction to the compiler?
doesn't the compiler already know where to find raylib.h given that we've hard coded that into our source file?
thanks again; much appreciated
#include "somefile.whatever" is literally a cut+paste operation. That is all you need for compiling your code. But that include never gets to the linker as it is consumed by the pre-processor.
( You can stop reading here. That is the answer. Below is more detail. )
Compiling doesn't create an executable, it creates "compilation units".
A lot of time, with a dead simple C program where you have zero external dependencies, you have only 1 compilation unit. Which is why I think sometimes people get lazy and say "compile your program" when they really mean "build your program". Where "build" means "compile and link".
Since you are using "raylib" functions, when you link together your compilation unit with the raylib compilation unit (raylib.a) , the linker needs a way to cross check the raylib functions you are calling and be all like "Do these functions really exist in raylib.a ?"
Technically a ".a" file is not a compilation unit, but a collection of compilation units.
Whereas a ".o" file is a single compilation unit.
Hopefully I got all that correct. Here is some of the stuff I looked at on stack overflow while answering. As my understanding of compiling and linking is pretty rudimentary myself.
stackoverflow.com/questions/59251013/
stackoverflow.com/questions/18548157/
stackoverflow.com/questions/654713/
this is by far, the least painful libary to compile from scratch. thank you for this
Nice to hear and glad this helped!
Great explanation and tutorial! Simple way to get it working outside of visual studio
Thanks! You’re welcome. Glad you found it helpful.
Thank you so much. I was going nuts with trying to set this up, since I'm new with C and everything. Should've watched this first lol
Np, glad you found it useful!
liked and subbed, first time(due to bad version of mingw I think wich I realised too late(a good 1 year while I was doing only terminal based programs)) I achieved downloading a graphics library THANK YOU!
After a WHOLE day of trying I got to your tutorial and it worked tysm!!! earned a like.
Great video dude. Helped so much!
This one still works on version 5.0. Thank you for making the compilation easy to do.
Bro does it work for you that said run.ps1
@@kirubelalemayehu10c67 nope, it didn't. I just decided to manually type in the g++ (i'm using c++ so I used g++ for the terminal) everytime
It can work if you tinker with the powershell security though, but uhhhhhhh I don't wanna and I'm not privy enough on how to do that
this was massively helpful, thank you
@@aarondevelops you’re welcome :)
Thank you very much, this is one of the rare ones that is actually helpful.
Thank you so much for this tutorial bro, you were super helpful
when installing mingw it says the file has been downloaded incorrectly
Then you have the wrong file had this with the non minimalist exe.
All is well except when I go to download the mingw64 bit, it only gives a zip file, no installation wizard at all. What do I do? I was running on mingw32, but since apparently raylib is not compatible with that, I must install mingw64, which is giving me trouble. It's things like this that steer me away from programming. I suppose it's just a stumbling block I must get over if I want to succeed with programming. But jeeze... I've been spending hours just trying to get my IDE to be able to detect this library without any errors.
What am I supposed to do when I go to the same link you went to to get mingw64, and it just gives me a zip file with a bunch of other files in it, no installation wizard. It's upsetting because I am a novice programmer, and It feels like little things like this go over so smoothly with others, and here I am spending hours just trying to successfully build it. Sigh. I just want to make an algorithm visualizer in c++.
How do I do it with cmake?
I opened command prompt in src folder and typed "cmake .."
This should've given me a dll file (instead of .a file), but I got include errors. Basically cmake can't find files it needs to include from raylib/cmake, although that directory is present with all the files
Absolutely awesome tutorial!
Thank you! this helped me a lot in understanding the underlying stuff.
:)
awesome tutorial! is there any way to get the exe to run without a command prompt opening up in the background?
@@garethwong-n8c yeah. It’s a compiler flag. If you can’t find it let me know and I’ll look.
Thanks for this. I've been tinkering with Raylib as a novice programmer. I've been looking for tutorials but there aren't very many for Raylib yet.
No worries! Let me know if you have any questions or if there is another video that you would find helpful.
@@rudyfaile I'm probably too new at all this but I've gone through nearly every example on the site. I love the way it looks and I'm ready to take a deep dive but I'm having trouble understanding how to combine the examples in a sensible way. Like how could a first timer make the transition from tinkering with examples to integrating multiple examples together? Like an opening menu that can transition you onto a play field.
@@heyitsandrew2209 have you looked at github.com/raysan5/raylib/tree/master/templates ?
Bro there is some error during buliding raylib it's rmodule.o error can u help pls
I'm getting this too for version 4.5.
Anyone know what the issue is? At this point I've just downloaded the source from the same location, just a more recent version, so I have no idea why it would be throwing errors since there's literally no other changes on my part.
Was getting an error building one of the example projects:
"skipping incompatible"
Solution was to run "mingw32-make clean" in raylib's src directory, then rebuild raylib. Replacing the raylib files I was using in the example project fixed the problem.
Yes! This saved me today
when compiling the library i get this error:
Makefile:589: recipe for target 'raudio.o' failed
mingw32-make: *** [raudio.o] Error 1
I had the same issue at first, I was using my already installed minGW but after reinstalling minGW it was fixed.
@@mmaaauuuuiiiii ok, I Just removed raudio.c from the makefile
x2
very nice video! I have a question, how do I compile my game in release mode? so I don't have the console window show up.
It's a compiler option. Check out github.com/rfaile313/draw_game/blob/master/compile/win/run.bat#L23
@@rudyfaile thank you :)
Thank you very much! I was playing around with the Go raylib lib but it has some bugs so I decided to try out the official C version. :)
This changes nothing about the video, but if you want to know more or found the mixing of MinGW and GCC confusing, this is for you:
MinGW isn’t a compiler. GCC (GNU Compiler Collection) is the compiler and it’s included with MinGW. What is MinGW then? It’s a minimal set of tools and libraries common across GNU-based OSs, but tailored for Windows applications. Minimalist Gnu for Windows = MinGW. It gives you the development environment you have on GNU + Linux, but allows you to create native Windows applications on Windows as well as on GNU + Linux.
Great explanation! For what it's worth, I was aware of this when I created the video (and I think I kind of mention it when I discuss gcc and compilers in general) but didn't want to confuse beginners too much by getting too deep in the woods with the nuances of development on windows. Thanks for your clarifying comment!
Hi, i followed this turorial but i want to code in c++. I enter the command and it says "-std=c99" is valid for C/ObjC but not for C++. Any ideas how i could? Without having to reinstall everything?
My guess is your Mingw/gcc installation is missing C.
My reasoning: When I install gcc I intentionally remove all C++ stuff so I never accidentally compile "C++" code. Possibly you intentionally did not install "C" so you wouldn't accidentally compile "C" code as you are a "C++" dev?
so I want to use c++ instead of c, what compiler flag should i use in place of std=c99?
how could i do if i wanted to move all the .c file in a src file and then compile? if i try it says it can't find raylib, even if i change the command line or the include/raylib in just raylib
im getting a error: "gcc.exe: error: -E or -x required when input is from standard input"
same
man wtf did u do to solve it
Cheers! A really awesome guide. Lots of thanks.
Thank you!
Is it similar if I do this for c++? The only difference i know of is using g++ instead of gcc and not using std -c99 i guess.
Please let me know if there are any other changes i gotta do.🙏🙏
I had this setup on my previous PC, but now it doesn't work anymore. I am not using Visual Studio Code, but Visual Studio Community 2022, and I am not sure which paths to add or where... It can find the header file for raylib, but then the linker complains that there are unresolved external symbols for all the built in things such as "InitWindow" etc.
Great tutorial bro, just sad I cant use it since I got an error around 5:45. I've been trying to redo it for like 5 times now reinstalling everything but to no avail. Good tutorial nonetheless cheers bro
now the mingw link is a collection of lib and header files. its not an installer anymore and i dont know what to do anymore
What do you do if you have Cyngus/Cynwin? installing MinGW doesn't work for my system I keep getting a download did not install correctly.
What do you do if you have Cyngus/Cynwin are there any -make commands for Cyngus and if there is where do I find them?
I cant seem to get the installer to work ( for mingw) , would you happen to have any idea why? It says "The file has been downloaded incorrectly!" I have tried reinstalling the program.
When compiling the basic window I'm receiving an error that it skips the incompatible lib//libraylib.a looking for -lraylib I've also tried changing the "-L lib/" to "-L lib" and that gives me the same error just skipping lib/libraylib.a. I didn't have a problem compiling raylib. Does anyone know what might be causing this?
The full error:
C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib//libraylib.a when searching for -lraylib
C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib/\libraylib.a when searching for -lraylib
C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib//libraylib.a when searching for -lraylib
C:/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lraylib
So if anyone is running into this issue I found a fix. When I compiled raylib the first time I used GitBash since that is the terminal I prefer, however when I recompiled raylib in powershell the new libraylib.a seems to work. I'm not sure why compiling in powershell instead of gitbash fixes the issue. If anyone knows why this happens I would love to know.
@@mmaaauuuuiiiii Thanks! I used command prompt and I had the same issue. Used powershell instead and it worked.
I would also love to know why this happened.
i am having the same problem and i tried to compile with powershell and it didnt worked as well. Can anyone help me please?
Could you please help me how to change to c++ . Are there any changes ? . Thank you for reading ❤ hope i get help from you❤
in the compile command i got en error saying "cc1.exe: error: argument to '-O' should be a non-negative integer, 'g', 's', or 'fast'
im completely lost can i get some help?
when in doubt, remove the "-O" flag as it isnt important to get the executable compiling
I have a problem because I have installed mingw through msys and the make command doesnt work. Can someone help me pls?
I'm new to C and it was pretty much exactly what I needed thank you !
Quick question for anyone though : where do the flags "-lopengl32 -lgdi32 -lwinmm" come from ? Where do you find which libs the compilation needs (apart from libraylib.a of course) ?
It doesn't seem, to me, that any kind of documentation mentions them, but of course it's not true, I just can't find it :/
9 months late but, winmm and gdi32 are libraries every windows system has, they will be available on 100% of windows machines (unless you messed up some configuration), opengl32 is usually externally downloaded, but raylib packages it's own openGL, basically when you compile raylib you also compile a openGL, windows libraries end with .a, those are linkable, .dlls have to be loaded at runtime and they need to be in the same folder as the .exe you compiled.
This was very useful, thank you!
5:45 my ps returned
Makefile:589: recipe for target 'raudio.o' failed
mingw32-make: *** [raudio.o] Error 1
Sounds like 32 bit version of mingw and not 64 bit
@@rudyfaile thanks
@@rudyfaile It's ok if I build using notepad ++? cuz i can't install the mingw like you did
@@melissamuniz2567 you can build using notepad++ using my approach or you can build using raylib’s notepad++ script it’s up to you
bro, can u help me once again?
Very nice Rudy, thks ;)
it works really well but where is the documentation especially for -I include/ -L lib/ -lraylib -lopengl32 -lgdi32 -lwinmm. this command really helpfull than setting in ide
I am getting:
lib//libraylib.a(core.o):core.c:(.text+0x1638): undefined reference to `__mingw_realloc'
lib//libraylib.a(core.o):core.c:(.text+0x705a): undefined reference to `__mingw_free'
...
collect2.exe: error: ld returned 1 exit status
Do you have any idea?
I have the same problem too. I followed the steps exactly, and even re-made the vs project from scratch but it gives me the same error.
Use powershell. Not command prompt or whatever. To compile raylib
@@alan5506 fixed it a while ago by recompiling the source code from the command prompt. I don't know what the problem was but recompiling might just fix it.
@@Φοιβος-ε2υ Recompile Raylib?
I am also getting this error. Does not help to compile raylib again.
Will you show us how to compile RayGui or ImGui too? (Thank you).
I am wondering if you would do a tutorial for getting it to work in Code::blocks which is my IDE of choice. I am going to have a go doing it the way you said, but then I am going to try and get it to work in Code::blocks, but I will probably mess up LOL.
This is great! Now I can use raylib with sublime. I really hate the interface of that NotePad-like editor that comes with it
Thank you, this helped me a lot !!
You're welcome!
Will the same thing work for raylib C# binding and can I have to use VScode or would I have to use a different IDE like VS 2017.
The C# Setup is different from the C/C++ setup. I've just been getting errors from even trying to setup C# lol
@@Cxdyy D:
@@thespontaneoustomato2676 Hey man, When I tried setting up Raylib C# in VS2019 it didn't work, but I tried it in VSCode and it worked :D
Open up the terminal, type "dotnet new console"
then after that is setup type "dotnet add package Raylib-cs --version 3.7.0"
and then to run it, type "dotnet run"
@@Cxdyy ok
Heyy amazing video on Raylib... Indeed so good... Thanks so much... Greethings from Dayton Ohio
excited for next ep :)
I wasn't planning on making one - what would you like to see in another episode?
@@rudyfaile Good Question :D,
Maybe something along the lines of basic physics simulation?
Maybe simple use of tiles and sprites?
There is loads of documentation on raylib so it doesn't matter if you don't have the time or weren't planning on doing a follow up - it is a great video on its own. Would be nice though :D.
Really enjoyed the video.
not able make static library
how do i link multiple .h/.cpp files? :(
finally i found one that works, man i love u
thank you so much :) to make things even easier, choco install mingw installs mingw with one command in the terminal (execute it as admin)
Folks might not have choco installed. This guide is assuming someone has nothing that's why the first step is checking your system's path.
@@rudyfaile oh sorry, I thought that's already by default installed on newer Windows versions
@@PySnek it’s possible! If so, it’s not something I’m aware of 😁
Hey what if i want to make a .exe file in opengl 1.1 or 2.1?
This was a great help!
Is there going to be a GNU/Linux tutorial?
No😭 One day I had raylib working without inlcuding the lib/include folders. It was just #include But I don't know to do it anymore, I added the lib/include to my windows variable PATH, but it isnt working😭
type this in terminal and hit enter it should work fine
gcc -o main.exe main.c C:
aylib
aylib\src
aylib.rc.data -s -O2 -IC:
aylib
aylib\src -LC:
aylib
aylib\src -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99 -Wall -mwindows
no need to add any sort of file or folder
just make sure raylib is installed in default directory (i.e C:/raylib)
and copy paste basic_core_window.c to main.c
@@Ashwin_1198 Never thought I would get a reaction. I chabged c++ built in library and added raylib there. But thanks for this command, should come in handy🤌🏻🫶🏻
I hope you're still active because I need some help.
I'd like to have a src folder with all the code to make it a bit clearer. If I run the build commands for the compiler from the src folder, it says it can't find raylib.h. Is there a change I'd have to do to make it possible for this to work.
I can get it to build if I run the commands from the main dir, and just reference the main.c in the build commands with gcc src/main.c etc. but this would cause problems with the stuff the source code references no longer matching its relative file path.
Is there a way I could slightly modify the gcc build commands so that it works from within c.
Also thanks for the video.
If you mean you have it setup like:
[some-project-folder]
|
|-----[include]
| |-----------raylib.h
|
|-----[lib]
| |----------libraylib.a
|
|-----[src]
|-----------main.c
And you want to run the compiler command from the "src" directory.
It's looking for "include" and "lib" in the "src" directory when they are in the parent directory.
Changing:
-I include/ -L lib/
to
-I ../include/ -L ../lib/
So it looks for those directories in the parent directory should suffice.
(edit: removed unnecessary tip)
You can try to type
../include/
two dots mean to go back a directory
Fantastic video, thanks!
Glad it helped!
Can you do a video on how to organize a large project?
Thanks this really helped.
Thanks for the video. Would be much more helpful as text article, but I guess we have no other choice anyway.
Quick question? Is this the same process for clion
No - you'd probably want to look into the IDE's instructions.... looks like others have had success: github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)#building-with-clioncmakeemscripten-for-web
Thank you so much!
Hello, great video, just easy to understand
Thanks!
is it possible to remove the console logs?
because for every change of the screen, there is a log in the console
@@florianunterfrauner2041 do you have an example?
@@rudyfaile i have solved it with adding some flags
excellent tutorial
Thanks for this. Could you make a similar video showing how to install Allegro 5.2.6 in a similar way so that we can use it in vscode or sublime text.
You're welcome. Unfortunately I have never used Allegro so I probably wouldn't be the best person to make a video for it.
@@rudyfaile Ok, thanks.
Great video! I’d love to see one using Linux.
It’s even easier on Linux because you’re going to have gcc and make in your path on 99% of distros.
does it also work with c++ or no?
I see no reason you can't make this method work with C++
"This app cant run on your computer" Help!!!
This is almost always because .dll files are missing & need to be placed in the same directory as the executable. Sorry you didn't get a timely reply, hopefully this can be useful to you or someone else reading
Really helpfull, thank you!
You are my heroooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!
Thank you!
It'd be nice if you explain how to configure it to work with Visual Studio tasks
That doesn't really have anything to do with compiling raylib, though I am sure you could create tasks to execute some of the commands in this video.
gracias!!!!!! alfin me funciono, aunque el modulo de audio me dio error entoces lo saque :v
Perdón que te moleste, pero al compilar como en el video, no incluye las librerias extras de Raylib, cierto? Cómo hay que indicar que queremos incluirlas en la compilación sino? Mi idea es tener todas las librerias extras incluidas también.
unrecognized command "-01"
Yeah, it's an "O" for optimization, not a 0 :)
no sabia que eras amigo del que hizo pistolero UwU
U SAY TO GET THE 64 BIT VERSION THEN U INSTALL AN .EXE THAT HAS BOTH 64 AND 32BIT. THEN U CHANGE ARCHITECTURE TO 64...BUT THEN U CHANGE IT BACK TO 32 AND TELL US TO MAKE SURE ITS THE 32BIT VERSION????? WTFFF????
relax buddy
u arent teaching people at all how to compile things themselves. i can give them countless other things and say "compile it" and they'd be lost.
ok
Awesome tutorial, however I am getting an error when I try to build it: *lib//libraylib.a(rglfw.o):rglfw.c:(.text+0x37fb): undefined reference to `__ms_vsnprintf'*
Does anyone know what might be causing it and how I could fix it?
I keep getting this error: Makefile:589: recipe for target 'raudio.o' failed
mingw32-make: *** [raudio.o] Error 1, any idea how to fix this?
Sounds like mingw 32 bit - I would recommend installing the 64 bit version
@@rudyfaile I solved the issue, I installed mingw for posix not win 32
i have look for so many tutorials and i still cant figure out how to get mingw32-make PLATFORM=PLATFORM_DESKTOP to work...
It gives me error 404 not found when I click MinGW-W64-builds :(
hey i have a question so i have MinGW and the GCC where command confirms it but the raylib file says it doesn't exists any help?
Thank you!
hey is it similar procedure for c++
@@RandomJeevanYT Yes