diff --git a/unittests/CppInterOp/TestSharedLib/TestSharedLib.h b/unittests/CppInterOp/TestSharedLib/TestSharedLib.h index 41fe7f758..8736f64bf 100644 --- a/unittests/CppInterOp/TestSharedLib/TestSharedLib.h +++ b/unittests/CppInterOp/TestSharedLib/TestSharedLib.h @@ -1,7 +1,11 @@ #ifndef UNITTESTS_CPPINTEROP_TESTSHAREDLIB_TESTSHAREDLIB_H #define UNITTESTS_CPPINTEROP_TESTSHAREDLIB_TESTSHAREDLIB_H -// Avoid having to mangle/demangle the symbol name in tests. -extern "C" int ret_zero(); +// Avoid having to mangle/demangle the symbol name in tests +#ifdef WIN32 + extern "C" __declspec(dllexport) int ret_zero(); +#else + extern "C" int ret_zero(); +#endif #endif // UNITTESTS_CPPINTEROP_TESTSHAREDLIB_TESTSHAREDLIB_H