DEV Community

Mytx
Mytx

Posted on

De[v]log#3: Compiling rayilb on powershell!!!

Image description
Image description

After 4 flipping days of constant head slamming....I managed to make it work!

These are all the error messages everytime I tried to compile raylib on cli

C:/raylib/w64devkit/bin/ld.exe: cannot find ..\../src/raylib.rc.data: No such file or directory
C:/raylib/w64devkit/bin/ld.exe: skipping incompatible ./libraylib.a when searching for -lraylib
C:/raylib/w64devkit/bin/ld.exe: skipping incompatible .\libraylib.a when searching for -lraylib

c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lraylib

c:/w64devkit/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lraylib
Enter fullscreen mode Exit fullscreen mode

I couldn't make it work on cli...so i tried to make things work with vscode yesterday....and it work...but kinda...it only work with c codes and I really want to make it work for c++ too...on side note...I somehow compiled the code without error but the output file isn't compatible for with window for some reason...curious case indeed

after trying everything I can think off....it finally compiled and run...

the method was...

https://github.com/raysan5/raylib/wiki/Working-on-Windows
Enter fullscreen mode Exit fullscreen mode

one of the section (Build ONE example using gcc/g++) tell you to run w64devkit.exe from raylib/w64devkit folder in C: and navigate to source and compile there...and it work...but it only work when I use w64devkit.exe from raylib/w64devkit folder.it doesn't work when I tried to compile from how do I say this....default w64devkit I installed on my C: drive...that is also the one I setup in my environment path -> C:\w64devkit

The error seems like it couldn't find the library necessary for raylib compilation...so I thought...maybe raylib/w64devkit folder have extra stuffs that default w64devkit I installed on my C: drive doesn't...so like any sane person would...I copy everything from raylib/w64devkit and paste them in default w64devkit...and voila I can now compile raylib source code from anywhere...and thus my problem is resolved....

For fresh installation:

  • install raylib with window installer
  • remove mingw path if there is any to avoid any conflicts
  • put C:\w64devkit\bin in the path and I guess that is pretty much it

I am so glad the problem is solved and....I can actually start coding...well that is what I want to say at least but now I gotta change astronvim c++ syntax highlight from c++11 to c++20...I somehow managed to do that in my wsl..but I tried so many stuffs in the process...I don't remember which one actually worked...but that is for another day xD...i m just gonna enjoy my little accomplishment and play some katana zero...

Top comments (0)