I'd like to do a compilation of two files which contain main methods by excluding or omitting the main method defined in one.
To give some background:
I'm trying to automate testing student-submitted code against a main method I provide.
My trouble is that the student code also included a main method. I'm wondering how I can compile (using g++) the file while excluding main. I'd just like to get the object code for the methods they define and link that with my new main method.
I'd rather find an automated way to do this rather than be forced to edit by hand 100s of submissions to remove / replace the main method.
Thanks