Skip to content

Commit

Permalink
- fix in cpp runtime loading math library
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12912 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Sep 13, 2012
1 parent 186ab3f commit 886aea0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Source/Math/Interfaces/OMAPI.h
Expand Up @@ -10,7 +10,7 @@
# define OMC_API __declspec( dllexport )
# else
# define OMC_API __declspec( dllimport )
# pragma warning( disable : 4251 ) // 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
# pragma warning( disable : 4251 )// 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
# endif
#endif

Expand Down
14 changes: 10 additions & 4 deletions SimulationRuntime/cpp/Source/SimManager/Main.cpp
Expand Up @@ -117,21 +117,27 @@ int main(int argc, const char* argv[])
fs::path modelica_system_path = modelica_path;
modelica_system_path/=modelica_system_name;

fs::path math_name(MATH_LIB);
fs::path math_path = modelica_path;
math_path/=math_name;

fs::path default_system_name(SYSTEM_LIB);
fs::path default_system_path = libraries_path;
default_system_path/=default_system_name;



default_system_path.make_preferred();
modelica_system_path.make_preferred();

math_path.make_preferred();

type_map types;
if(!load_single_library(types, default_system_path.string()))
throw std::invalid_argument("System default library could not be loaded");



shared_library math_lib(math_path.string());
if(!math_lib.open())
throw std::invalid_argument("Math library could not be loaded");

if(!load_single_library(types, modelica_system_path.string()))
throw std::invalid_argument("ModelicaSystem library could not be loaded");
Expand Down
Expand Up @@ -59,7 +59,7 @@ inline bool load_single_library(type_map& current_type_map,
if (!lib.open()) {
return false;
}
void (*func)(type_map&) =
lib.shared_library::get<void, type_map&>
("boost_extension_exported_type_map_function");
Expand Down

0 comments on commit 886aea0

Please sign in to comment.