You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am building an optimization problem that should use external code as part of the objective function. I have built a small example that reproduces the error:
The objective function code generates and builds without issues but I get compiler errors when trying to compile the generated nlp.c file even though the optimization problem runs fine inside the python example:
nlp.c: In function ‘nlp_smoothing_diff_err’:
nlp.c:211:55: error: ‘static_cast’ undeclared (first use in this function)
211 | wk = casadi_smoothing_diff_weights(k, yb, yc, yf, static_cast<casadi_real*>(0));
| ^~~~~~~~~~~
nlp.c:211:55: note: each undeclared identifier is reported only once for each function it appears in
nlp.c:24:21: error: expected expression before ‘double’
24 | #define casadi_real double
| ^~~~~~
nlp.c:211:67: note: in expansion of macro ‘casadi_real’
211 | wk = casadi_smoothing_diff_weights(k, yb, yc, yf, static_cast<casadi_real*>(0));
| ^~~~~~~~~~~
nlp.c: In function ‘nlp_f6’:
nlp.c:812:39: error: expected ‘)’ before ‘;’ token
812 | if (mid = casadi_f1_checkout();
| ~ ^
| )
If I manually fix the errors to atleast make the code compile I get this error when loading nlpsol with external code:
symbol lookup error: nlp.so: undefined symbol: objective_incref
How do I link external code to other external code?
I am using the latest casadi version 3.6.5
Regards,
Linus
The text was updated successfully, but these errors were encountered:
Hi,
I am building an optimization problem that should use external code as part of the objective function. I have built a small example that reproduces the error:
The objective function code generates and builds without issues but I get compiler errors when trying to compile the generated nlp.c file even though the optimization problem runs fine inside the python example:
If I manually fix the errors to atleast make the code compile I get this error when loading nlpsol with external code:
How do I link external code to other external code?
I am using the latest casadi version 3.6.5
Regards,
Linus
The text was updated successfully, but these errors were encountered: