Error compiling multiple .F files into single DLL
Hi there, I am trying to compile multiple Fortran files into a single DLL and am getting the following message when creating the DLL. The files AVR1OEL.F, AVR1UEL.F and AVR1_AVR.F all compile correctly on their own and I can create three usable DLLs, but I want to have only one DLL which contains all three models. Any ideas what is going wrong here?
link /INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:WINDOWS /MACHINE:X86 /ERRORREPORT:PROMPT
@"C:\Users\Patrick\.pssenvmgr\linkfilestvxtmu.txt" /OUT:"C:\Users\Patrick\.pssenvmgr\AVR1_v34.5.dll"
/map:"C:\Users\Patrick\.pssenvmgr\AVR1_v34.5.map"
AVR1_OEL.obj : error LNK2005: _MAIN__ already defined in AVR1_AVR.obj
AVR1_UEL.obj : error LNK2005: _MAIN__ already defined in AVR1_AVR.obj
C:\Users\Patrick\.pssenvmgr\AVR1_v34.5.dll : fatal error LNK1169: one or more multiply defined symbols
found
ERROR during link(1)... Aborted
Also worth noting that I do not have any "main"s in the .F files, and only subroutines have been used (i.e.no programs)
Do you have subroutines with the same name in the three files?
Are you defining the same global variables in each *.F file? It's difficult to diagnose your issue without seeing the source code, which I presume is confidential. It is certainly possible to achieve your objective here, it's just a question of structuring your code correctly.