Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » jf3
  • » Profile

Posts

Posts

Mar-21-16 14:13:25
Compiling a model with msvc

Hi  Akshay,

unfortunately I had to give up this activity. Only simple model could be compiled. More complex models would require manual checking which is very difficult.

There are other way to co-simulate with CarMaker. What about making FMU out of your model.

Regards,

Josef

Dec-16-15 18:15:16
Compiling a model with msvc

When I use Cpp target for a simple model it does compile the model. It looks to me it has something to do with change() function in the when-statement.

Also I found some issue in C++ generated code (see bellow), the second else if statement starts wrongly with forward slash.
When I delete this then I can compile the Cpp target by re-running nmake.

Code:


void IModel::evaluate_482()
{
  if (_initial)
  {
      ; // nothing to do
  }
  else if(0 || (_$whenCondition15 && !_discrete_events->pre(_$whenCondition15)))
  {
    _state_var_reinitialized = true;
      __z[24]   = 0.0;
  }
  /else if(0 || (_$whenCondition14 && !_discrete_events->pre(_$whenCondition14)))
  {
    _state_var_reinitialized = true;
      __z[24]   = 0.0;
  }
  else if(0 || (_$whenCondition13 && !_discrete_events->pre(_$whenCondition13)))
  {
    _state_var_reinitialized = true;
      __z[24]   = 0.0;
  }
  else
  {
     ; // nothing to do
  }
}

Thanks.

Dec-16-15 16:14:25
Compiling a model with msvc

I tested the Cpp code target with msvc, but it does not work. I got quite a bit of warnings and errors about undeclared identifiers:

error C2065: 'tmp39' : undeclared identifier
error C2065: 'tmp39' : undeclared identifier

and about syntax error:

error C2146: syntax error : missing ';' before identifier 'tmp39'

Thank you for your help.

Dec-16-15 13:57:23
Compiling a model with msvc

I tried, but I'm still getting an error.
Please, any idea why?

Thanks!

Code:

IModel.obj : error LNK2019: unresolved external symbol _checkForSynchronous referenced in function "int __cdecl IModel_performSimulation(struct DATA *,struct threadData_s *,struct SOLVER_INFO *)" (?IModel_performSimulation@@YAHPAUDATA@@PAUthreadData_s@@PAUSOLVER_INFO@@@Z)

IModel.obj : error LNK2019: unresolved external symbol _handleTimers referenced in function "int __cdecl simulationUpdate(struct DATA *,struct threadData_s *,struct SOLVER_INFO *)" (?simulationUpdate@@YAHPAUDATA@@PAUthreadData_s@@PAUSOLVER_INFO@@@Z)
solver.lib(linearSystem.c.obj) : error LNK2019: unresolved external symbol _freeKluData referenced in function _freeLinearSystems
solver.lib(linearSystem.c.obj) : error LNK2019: unresolved external symbol _allocateKluData referenced in function _initializeLinearSystems
solver.lib(linearSystem.c.obj) : error LNK2019: unresolved external symbol _solveKlu referenced in function _solve_linear_system
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _omc_write_csv_init referenced in function _initializeNLScsvData
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _omc_write_csv referenced in function _print_csvLineCallStatsHeader
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _allocValueList referenced in function _initializeNonlinearSystems
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _omc_write_csv_free referenced in function _freeNonlinearSystems
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _freeValueList referenced in function _freeNonlinearSystems
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _cleanValueListbyTime referenced in function _cleanUpOldValueListAfterEvent
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _addListElement referenced in function _solve_nonlinear_system
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _createValueElement referenced in function _solve_nonlinear_system
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _getValues referenced in function _solve_nonlinear_system
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _printValuesListTimes referenced in function _solve_nonlinear_system
util.lib(modelica_string.c.obj) : error LNK2019: unresolved external symbol _va_copy referenced in function _GC_vasprintf
initialization.lib(initialization.c.obj) : error LNK2019: unresolved external symbol _initSynchronous referenced in function _initialization
IModel.exe : fatal error LNK1120: 17 unresolved externals
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
RESULT: 2

Dec-15-15 23:28:10
Compiling a model with msvc

Hi all, I'm using OpenModelica 1.9.3. When I'm compiling a model with target set to msvc I'm getting this error:

Code:

IModel.obj : error LNK2019: unresolved external symbol _checkForSynchronous referenced in function "int __cdecl IModel_performSimulation(struct DATA *,struct threadData_s *,struct SOLVER_INFO *)" (?IModel_performSimulation@@YAHPAUDATA@@PAUthreadData_s@@PAUSOLVER_INFO@@@Z)

IModel.obj : error LNK2019: unresolved external symbol _handleTimers referenced in function "int __cdecl simulationUpdate(struct DATA *,struct threadData_s *,struct SOLVER_INFO *)" (?simulationUpdate@@YAHPAUDATA@@PAUthreadData_s@@PAUSOLVER_INFO@@@Z)
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _omc_write_csv_init referenced in function _initializeNLScsvData
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _omc_write_csv referenced in function _print_csvLineCallStatsHeader
solver.lib(nonlinearSystem.c.obj) : error LNK2019: unresolved external symbol _omc_write_csv_free referenced in function _freeNonlinearSystems
initialization.lib(initialization.c.obj) : error LNK2019: unresolved external symbol _initSynchronous referenced in function _initialization
IModel.exe : fatal error LNK1120: 6 unresolved externals
NMAKE : fatal error U1077: 'cl' : return code '0x2'

Any idea how to solve that, please?

Thanks, Josef

  • Index
  • » Users
  • » jf3
  • » Profile
You are here: