Opened 5 years ago
Closed 5 years ago
#5916 closed defect (fixed)
Call to external "C" does not work when DAE mode is activated
Reported by: | Owned by: | Karim Adbdelhak | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.16.0 |
Component: | Backend | Version: | v1.14.1 |
Keywords: | Cc: | adrien.guironnet@…, Andreas Heuermann |
Description
Hello,
Compilation fails systematically when DAE mode is activated and a model contains a call to an external C fonction with an additional include:
function myFunc
input Integer a;
external "C" myExternalFunc(a) annotation(Include = "#include \"MyHeader.h\"");
end myFunc;
It seems that the include is not properly added in the generated files.
Please note that it works fine without DAE mode.
Regards,
Florentine ROSIERE
Attachments (1)
Change History (6)
comment:1 by , 5 years ago
Cc: | added; removed |
---|---|
Component: | *unknown* → Backend |
Milestone: | Future → 1.16.0 |
Owner: | changed from | to
Priority: | high → blocker |
Status: | new → assigned |
follow-up: 3 comment:2 by , 5 years ago
Do you have a minimal working example for me? Like calling a helloWorld-C-function.Then I can have a quick look into it.
I guess either the annotation is lost in the DAE case or copying / compiling / linking is wrong.
comment:3 by , 5 years ago
Replying to AnHeuermann:
Do you have a minimal working example for me? Like calling a helloWorld-C-function.Then I can have a quick look into it.
I guess either the annotation is lost in the DAE case or copying / compiling / linking is wrong.
Hi,
I added an attachment in the ticket with a minimal example showing the issue.
It works fine without the daeMode flag, and fails with it.
Regards,
Florentine
comment:4 by , 5 years ago
This small commit did the trick for your minimal model. It seems like the full path and the simple name string for includes got mixed up here.
Feel free to close the ticket if it also works for the intended model!
@Karim, @AnHeuermann, this is probably an oversight, can you please check if this is a quick fix? Of course we need external functions in DAE mode as well