CasADi S-Function Example (posted in blog) mex command returns error

46 views
Skip to first unread message

Batu Özmeteler

unread,
Apr 18, 2020, 2:37:28 PM4/18/20
to CasADi
Hello all,

I am new to CasADi and I'm trying to understand how the code generation works. I downloaded 
the files provided in https://web.casadi.org/blog/s-function/ to go over the example. The CasADi code
generation works fine however, the  'mex s_function.c f.c' line returns an error (the photo of the error
is attached). I use Matlab2014b and CasADi 3.5.1 release. Thank you for your attention, an answer will
be greatly appreciated.

Kind regards,

 
Error.png

Batu Özmeteler

unread,
Apr 19, 2020, 6:01:03 AM4/19/20
to CasADi
I have found what seems to be the problem. I was using the C compiler as default
therefore, I was receiving these errors since all block variables need to be declared at
the beginning of the block (C89). I have changed to an C++ compiler and renamed my file 
to end with.cpp Now, everything works fine. (bad mistake)

18 Nisan 2020 Cumartesi 21:37:28 UTC+3 tarihinde Batu Özmeteler yazdı:
Reply all
Reply to author
Forward
0 new messages