This is a simple hot reload of a plugin code file in the Odin programming language.
This code has 2 shared libraries, one static ( for the file changing monitor ) and one dynamic ( for the hot plugin ). IT has code in C and in Odin.
Now there are no problems, it's working fine!
Before you build this project of this repository, you have to make a directory called the following and copy or move one file to it.
$ mkdir plug_dir
$ cp dll_plug_code.odin ./plug_dir/dll_plug_code.odin
1. First clean the code objects previously generated.
$ make clean
2. Then build all the code objects.
$ make all
3. Run the program, this will load the ".so" Shared dynamic library in Linux
( for the hot plugin code) and the ".a" static library ( for the file change
in C ).
$ ./hot_reloadeble_program
4. Now change the code in the "dll_plug_odin.odin" file and save it in VScode
or emacs or vim.
$ code dll_plug_odin.odin
5. Now build the "dll_plug_odin.odin" file again (You can do this several times,
that's the all point of this peace of code! ).
$ make dll_plug
6. It will update automatically.
7. Now you can see the changes in the program0s output.
Mit Open Source
Best regards,
Joao Carvalho