help creating .so and linking into other applications (c++)
Hey guys n gurls, before i get told to RTFM, i did, and TFM went over my head.
im on a computer science course.
at the start of the year, i wrote an amasing memory management class that allows the dynamic allocation of memory, addressable as smaller than char (byte) arrays.
for example, i could declair an array of 100 3 bit wariables, and address each 3bit variable as an array index, whereas a normal char array would have wasted 5 bits in each array index. ANYWAYS.
i find myself copying and pasting this code into almost off my my AI porgrams,
i would like ot compile it once as a .so (shared object)
and link it into my other aplications, saving compile time, and generally keeping my code clean.
i know i need a g++ compiler option to compile the code as a shared object, but i cant find it... (honestly, i did (skim) read the entire gcc man page {SRTFM}) lol
then write a header file with funcrion / class prototypes to #include into the main program.
then compile the main program with a parameter to link in an .so that is not stored in the normal library folder.
any tips or advice, or a link to a tutorial on the basics ?
all the online how-to's go into too much depth, explaining interprocess cominucation and all the lot.
thanX
|