vi editor in beaglebone to run an opencv program

I have an opencv code. can I use the vi editor available in the angstrom to write the program and use gcc to compile the same.? is any linking of
opencv libraries necessary ? if so what is the procedure?

Yes. The editor has nothing to do with your opencv code. You would need to
follow the same procedure for compiling and linking against the opencv library
as you would on a typical desktop environment. Search the archives for
the exact steps.