Hi,
In ExternalLibraries.mos there are these two commands:
system("gcc -c -o libExternalFunc1_ext.o ExternalFunc1.c");
system("gcc -c -o libExternalFunc2.a ExternalFunc2.c");
Your result for running these commands are 256
which means an error. For me these calls return 0.
Try to add some logging to these calls:
system("gcc -c -o libExternalFunc1_ext.o ExternalFunc1.c
> trace1.txt 2>&1");
system("gcc -c -o libExternalFunc2.a ExternalFunc2.c
> trace2.txt 2>&1");
Then have a look in those trace*.txt.
It also might be the case that you
need to add ./ in your PATH variable.
Cheers,
Adrian Pop/
Jason Brown wrote:
Hello,
I've been putting together some external C functions, but the variables
in my model are not written to the *_res.plt file. As a test I've tried
running the "ExternalLibraries.mos" file in the 'Examples' folder, and
here's the result:
>>>
runScript("/Users/jasonbrown/opnmodlca/OpenModelica/Examples/ExternalLibraries.mos")
"false
256
256
record
resultFile = "ExternalLibraries_res.plt"
end record
true"
The only variable in ExternalLibraries_res.plt is time (and $dummy); no
mention of the variables x and y.
ExternalLibraries.log contains:
g++ -I"/Users/jasonbrown/opnmodlca/OpenModelica/build/include" -I.
-I"/Users/jasonbrown/opnmodlca/OpenModelica/build/work" -o
ExternalLibraries ExternalLibraries.cpp
-L"/Users/jasonbrown/opnmodlca/OpenModelica/build/work" -lsim
-L"/Users/jasonbrown/opnmodlca/OpenModelica/build/lib" -lc_runtime -lf2c
-lsendData
Any ideas as to what I'm doing wrong?
Thanks,
Jason
--------------------------------------------
Jason Brown
Georgia Institute of Technology
College of Architecture
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>