Skip to content

Commit e1a161b

Browse files
committed
fix library loading in calculator example
1 parent 0a82e03 commit e1a161b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Examples/Calculator/Calculator_component/Examples/CppDynamic/Calculator_example.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ int main()
2222
try
2323
{
2424
std::string libpath = (""); // TODO: put the location of the Calculator-library file here.
25-
auto wrapper = Calculator::CWrapper::loadLibrary(libpath + "/calculator."); // TODO: add correct suffix of the library
25+
auto wrapper = Calculator::CWrapper::loadLibrary(libpath + "calculator."
26+
#if defined _WIN32
27+
"dll"
28+
#elif defined __APPLE__
29+
"dylib"
30+
#elif defined __linux__
31+
"so"
32+
#endif
33+
); // TODO: add correct suffix of the library
2634
Calculator_uint32 nMajor, nMinor, nMicro;
2735
wrapper->GetVersion(nMajor, nMinor, nMicro);
2836
std::cout << "Calculator.Version = " << nMajor << "." << nMinor << "." << nMicro;

0 commit comments

Comments
 (0)