Compiling SWMM5 Source Code.


My work requires some modifications in the report file. Since SWMM5 is a free domain software I think  

some modifications  ( in report.c of Source code )  can help a lot in the long run of my project. Can you please explain how to compile the source code of SWMM5 ? I have a no previous experience of compiling from multiple .c  files so it would be a great  help if you guys help in this matter.


You need to be a member of SWMM 5 or SWMM or EPASWMM - (not formally associated with EPA) to add comments!

Join SWMM 5 or SWMM or EPASWMM - (not formally associated with EPA)

Email me when people reply –


  • Are you trying to make the console program swmm5.exe or the dll swmm5.dll?

    Your error message looks like you are compiling the wrong options

    at the top of swmm5.c you need to make the right choice

    // Leave only one of the following 3 lines un-commented,
    // depending on the choice of compilation target
    //#define CLE /* Compile as a command line executable */ //(5.0.014 - LR)
    //#define SOL /* Compile as a shared object library */ //(5.0.014 - LR)
    #define DLL /* Compile as a Windows DLL */ //(5.0.014 - LR)

    • Thanks Bob, I got the code compiled and its fully working. but however I left all the compilation target uncommented and it somehow worked.

  • hi,

    I am using visual studio 2005 and trying to compile the original code itself , but its giving me the following error. Thanks.


    error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

     fatal error LNK1120: 1 unresolved externals

  • Hi, The EPA has make files along with the source code here 

    The makefiles are 3293133236?profile=original

    I use Visual Studio Express, which is free for the 2010 version and the GUI for SWMM 5 compilation looks like this


This reply was deleted.