I am trying to call an external C code that use GLPK (GNU Linear Programming Kit) within my Modelica model. The C code works just fine, have tested it in a stand alone mode where all the inputs are self-supplied. When I tried to link it with my Modelica model, it starts to give me linker-type error, that is similar to below:
examples.SimpleSystemOptimalDispatch_functions.c:(.text+0x99d): undefined reference to `glp_set_row_bnds'
I notice that to run the C code in a stand alone mode, a special linker has to be used
gcc standalonecode.c -lglpk -o standalone
I believe the problem is in linking process, but I fail to grasp how to tell Modelica to do the link automatically. Any idea how to solve this linking problem in Modelica?
Thank you and best wishes