I will assume that you meant to say:
duplicate symbol _kernel1 in upfun.o and main.o for architecture x86_64
The linker is complaining that you have defined the symbol (a.k.a. variable) "kernel1" in more than one places.
The problem is that you have defined a variable "kernel1" in a header file main.h. This header file is getting included in more than one .cpp file. Therefore, you have effectively defined "kernel1" in more than one compilation unit.
The solution is simple. Move the definition of "kernel1" to main.cpp instead:
arma::vec (*kernel1)(arma::vec d, arma::vec m);
Update added to address comment:
It was pointed out the symbol "kernel1" is being used from another file as well. In which case,
The definition of "kernel1" still needs to happen in main.cpp as described above.
Add an "extern" declaration of kernel1 in the main.h header file:
extern arma::vec (*kernel1)(arma::vec d, arma::vec m);
This should address your problem.