The typical way to test a library is that you write a separate piece of code that exercises the libary, and compares the result with expected results.
In this case, the main
will go into the test program, not the library. Having a main
in the library is not the right thing, and will lead to very curious problems for the user of the library if the user forgets to supply a main
...