kolibrios/programs/develop/ktcc/trunk/lib/sample/howto.txt
Magomed Kostoev (mkostoevr) 90cf9246ac Implement dynamic linking with system libraries via -lsyslibname:
console.obj
http.ibj
InputBox.obj
Add header files for apps what dynamically link these libraries.


git-svn-id: svn://kolibrios.org@7925 a494cfbc-eb01-0410-851d-a64ba20cac60
2020-05-16 08:07:10 +00:00

14 lines
848 B
Plaintext

Create new library wrapper
1. Redefine lib_name and lib_name_str in __lib__.inc
2. Create file for each symbol, basing on sample_symbol.asm and for each:
2.1. Redefine fun to *your_symbol_name*
2.2. Redefine fun_name to '*your_symbol_name*' (with quotes, this is ASCII string, no trailing zero need)
3. Change make.bat as appropriate
ACHTUNG: lib_name need to be unique in project, this is why I started it with "@" and put "." into.
ACHTUNG: lib_name_str must be at least 5 symbols long, if is not, fix this adding padding to the path.
Now you can create header file and declare extern variables pointers-to-functions, and then link your app with -llibname (put .a file in lib folder).
For examples of such header files, look at include/kos/inputbox.h, include/kos/console.h and include/kos/http.h. IMO, first one is the simplest.