C++. Ability to run executable file with external libraries on another pc

39 views Asked by At

If I created a project using extenral library, raylib, for instance. I installed this library so raylib.h file is in ..\msys64\mingw64\include\ and I can run my program. But is there any ways to compile my main file and link it the way I'll be able to run it on other pc, where raylib library is not installed? Or anyway I'll have to install all the libraries I used on the other pc where I want to run executable file? I know it sounds weird, but I can't fully understand what the linker does when I write -lraylib parameter: g++ main.cpp -lraylib -o main Does libraylib file have a pre-compiled implemintaion code, doesn't it? And if it does, the linker just "combine" my main file and raylib library file, right?

I've complied and linked some project that uses raylib but I couldn't run it on another pc, the error said I had no necessary libraries installed to run .exe

0

There are 0 answers