jkenda / aback

A stack-oriented language that uses Polish notation which can be reversed using the ; operator (previously |>)
0 stars 0 forks source link

aback/core as a shared library #14

Open jkenda opened 1 month ago

jkenda commented 1 month ago

use ld instead of gcc?

To create a shared object (.so) file from one or more object files on Unix-like operating systems (including Linux and macOS), you typically use the gcc or g++ compiler (for C or C++ projects, respectively) with the -shared option. This tells the compiler to produce a shared library rather than an executable. Here's how you do it:

gcc -shared -o libmyshared.so file1.o file2.o file3.o

This command will take object files file1.o, file2.o, and file3.o and combine them into a shared object file named libmyshared.so.

Additional Considerations:

Here is an example command that compiles source files directly into a shared object, assuming the source files do not depend on other shared libraries:

gcc -shared -fPIC -o libmyshared.so file1.c file2.c file3.c

Remember, the exact command and options might vary depending on your specific development environment and the languages you're using.