Custom objective function not getting registered

I’m following the directions here to create a new objective function in C++. I’ve added my source to CMake, I’m building successfully, I’ve called XGBOOST_REGISTER_OBJECTIVE, and I can see my class in the built library using nm. But when I go to use it in my code, I’m getting the error “Unknown objective function” for the name I used. Is there a good way to debug this? I was looking at other implementations of object functions in the code base, it seems like most of them are defined in CUDA source files, could that be related to what I’m doing wrong?

I think I’ve figured this out. I am on MacOS and I don’t do much C++ on MacOS, I needed the equivalent of LD_LIBRARY_PATH for Mac which is DYLD_LIBRARY_PATH to ensure my built libxgboost was found and used. Turned out my home brew installed xgboost was being called.