import/export functions between Modules

I'm having trouble figuring out how to export/import IR functions at the
C++ API level. I think I've got the linking part figured out, but I need
to get the functions exporting from one module into another. I see how I
can iterate over the functions in one, but I'm not clear on how to
expose this name/reference into the other module.

Is there a simple example/tutorial of this somehwere? Or can somebody
give me the basic function calls?

I came up with this simple loop (import from base_module to module):

  auto & fl = base_module->getFunctionList();
  for( auto it = fl.begin(); it != fl.end(); ++it )
    module->getOrInsertFunction ( it->getName(), it->getFunctionType(),
it->getAttributes() );

I'm not positive this works. While I can resolve functions I then get an
error while trying to execute my entry function:

LLVM ERROR: Program used external function 'eval_expr' which could not
be resolved!