Is it possible to use LCC to link FORTRAN and C code in an S-function in Simulink 7.4 (R2009b)?

2 views (last 30 days)
I am trying to create a Simulink Level 2 S-function using the LCC C compiler, and the Compaq Visual Fortran 6.6 compiler. For instance, I am trying to create the S-function from the example files "sfun_atmos.c" and "sfun_atmos_sub.f", located in the directory:
$MATLABROOT\simulink\src
(where $MATLABROOT refers to the root MATLAB directory)
The documentation states that this example can be compiled using the Microsoft Visual C/C++. Since the LCC compiler is shipped with MATLAB, I expect that I should be able to link my Fortran object files and libraries with my C code using LCC. However, I am experiencing problems doing so. Specifically, I receive an error that "sfun_atmos_sub" contains an undefined reference to "__FIIfexp_". I have confirmed that this routine is present in DFOR.LIB, which is located, for instance in C:\Microsoft Visual Studio\DF98\LIB.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Jan 2010
The object file formats used by LCC and Microsoft are in general incompatible. They may unpredictably work together on occasion, but may not in other cases.
To work around this issue, try using the Microsoft Visual C/C++ compiler, such as Microsoft Visual C/C++ version 6.0.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!