Well..... I don't see any GnuCOBOL programs in your example. When I need to have many GnuCOBOL subroutines and other called C subprograms or Objects, I use Dynamic linking with Shared Objects. I combine all the subroutines and subprograms into one .SO file. And use the COB_PRE_LOAD environment parameter : export COB_PRE_LOAD=$HOME/lib/mwoc.so
My stand alone (executables) GnuCOBOL programs can call any of the subroutines.
I don't use Static Linking for my subroutines.
Last edit: Mickey White 2024-07-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was wondering if there are any specific commands to link and compile a main program with its dependencies in GnuCOBOL
In my case I am trying to do the following:
But there are more and more files I need to keep linking, so it keeps giving undefined errors
Well..... I don't see any GnuCOBOL programs in your example. When I need to have many GnuCOBOL subroutines and other called C subprograms or Objects, I use Dynamic linking with Shared Objects. I combine all the subroutines and subprograms into one .SO file. And use the COB_PRE_LOAD environment parameter : export COB_PRE_LOAD=$HOME/lib/mwoc.so
My stand alone (executables) GnuCOBOL programs can call any of the subroutines.
I don't use Static Linking for my subroutines.
Last edit: Mickey White 2024-07-25