diff --git a/examples/parameterized_custom_source/parameterized_source_ring.cpp b/examples/parameterized_custom_source/parameterized_source_ring.cpp index bd7bb1f6f..51218e1b3 100644 --- a/examples/parameterized_custom_source/parameterized_source_ring.cpp +++ b/examples/parameterized_custom_source/parameterized_source_ring.cpp @@ -62,6 +62,6 @@ class ParameterizedSource : public openmc::CustomSource { // A function to create a pointer to an instance of this class when generated // via a plugin call using dlopen/dlsym. // You must have external C linkage here otherwise dlopen will not find the file -extern "C" ParameterizedSource* create(const char* parameters) { +extern "C" ParameterizedSource* openmc_create_source(const char* parameters) { return ParameterizedSource::from_string(parameters); } diff --git a/src/source.cpp b/src/source.cpp index 4ddd3eb2a..673ee8804 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -380,7 +380,7 @@ void load_custom_source_library() custom_source_function = reinterpret_cast(dlsym(custom_source_library, "sample_source")); } else { // get the function to create the CustomSource from the library - create_custom_source_t* create_custom_source = (create_custom_source_t*) dlsym(custom_source_library, "create"); + create_custom_source_t* create_custom_source = (create_custom_source_t*) dlsym(custom_source_library, "openmc_create_source"); // create a pointer to an instance of the CustomSource custom_source = create_custom_source(custom_source_parameters.c_str()); diff --git a/tests/regression_tests/source_parameterized_dlopen/parameterized_source_sampling.cpp b/tests/regression_tests/source_parameterized_dlopen/parameterized_source_sampling.cpp index 3eda071e8..9fcb841d0 100644 --- a/tests/regression_tests/source_parameterized_dlopen/parameterized_source_sampling.cpp +++ b/tests/regression_tests/source_parameterized_dlopen/parameterized_source_sampling.cpp @@ -55,6 +55,6 @@ class ParameterizedSource : public openmc::CustomSource { // you must have external C linkage here otherwise // dlopen will not find the file -extern "C" ParameterizedSource* create(const char* parameters) { +extern "C" ParameterizedSource* openmc_create_source(const char* parameters) { return ParameterizedSource::from_string(parameters); }