Hi Im fairly new to C..but have many years programming java and want to do things like using the classpath option in java in anyone is familiar.
I want to compile several source into object files and I guess link them dynamically to keep my executable small as possible so I guess I want to link to .o files without going the through process of creating a dynamic library.
Can this be done or do I need to have a .so (on linux) to do this?
I am in habit of breaking things in many source files even while I am learning C now...for ex when I do some tests I typically create a source
where I place all my functions
it enables me to create several main programs for testing...
I know I can compile these to object files with a gcc -c option and even include func.o when I compile my main(s) and from my understanding the .o files get added to the executable....
what I want is to not add them to the executable but instead specify them at compile time and runtime.
Can I do this? If so can someone please enlighten me how...the options of gcc etc..are quite a handfull...
from the java side its like creating a class and compiling another using the classpath option if that makes sense.
Thanks in advance.