Cofunctions in external library

Is it possible to put cofunctions in an external library instead of having them in the main .c file? This would greatly improve the structure of my application. It doesn’t work to just move the cofunction function to the library at least, that generates a compiler error.