We used to work with static library and now decided to switch to dll. Here is the problem that we are facing. I have a large source file that contains hundreds of subroutines, but they can be classified into two kind of subroutines, one kind is the system subroutines (syssrc.for) which can not be reached by the users, while the other kind is the user subroutines (usr.for which are called by some routines in syssrc.for) which users can modify or print out some data from them.
The procedure I did is that,
1. Add !DEC$ ATTRIBUTES DLLEXPORT :: "nameofsubroutines" under every subroutines in usr.for.
2. Build dll using usr.for to generate dllusr.dll and dllusr.lib files.
3. Add !DEC$ ATTRIBUTES DLLEXPORT :: "nameofsubroutines" under every subroutines in syssrc.for
4. Build dll using syssrc.for and dllusr.lib (need dllusr.dll in the same folder), to generate dllsyssrc.dll and dllsyssrc.lib.
5. Create a application with main program and link dllsyssrc.lib.
In this way, I could call the subroutines in both usr.for and syssrc.for. But the usr.for that should be modified by users can not be overwritten or replaced the one in usr.for since these subroutine are embedded in dllsyssrc.lib.
Does anyone has idea what kind of modifications or configurations should I set to let the project ignore the usr.for in dllsyssrc.lib and use the updated one?
Thank you