Discussion ClosedThis discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one,click here.
Trying to include an external dll (compiled from c)
Posted 2024年1月14日 GMT+1 17:15API, Modeling Workflow, User InterfaceVersion 6.23 Replies
Please login with a confirmed email address before reporting spam
Hello,
I am trying to use a custom function in comsol. For testing purposes, I have written a short c file:
double f(double x, double y, double z); double f(double x, double y, double z) { double r; r = x * (1 + 1*(y-z) + 1*(y-z)); return r; }
Then I compiled my code as adviced on suggested oncygwinwith the commandsgcc -c test.c
and thengcc -shared -o test.dll test.o
.
Now in Global Definitions, I created a new instance with right click -> functions -> extern, filled out function name with "f" and arguments with "x, y, z" and finally created 3 entries in plot parameters ranging from 0 to 10 for every entry.
Now if I click "plot" or "create plot" I get an error saying "Symbol not found". I have googled and asked Bing "to google for me" but I dont find any resource that helps me here.
How do I make this work?