Compiling S-function using given matlab script #983
-
Hi! I am a new to using mex files and using cmake. I have installed it using window installer. And when I run the s-function compiling script on matlab, i get a long list of LNK errors for .obj in jsbsim.lib file. I am using matlab 2022b and VS 2015. If this issue is because of VS 2015, is there a way around because installing VS 2019 or later is not feasible for me at the moment. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello @MasterNomi I usually create the S-Function by generating the VS projects via CMake and setting the variable BUILD_MATLAB_SFUNCTION to true. @bcoconni and @seanmcleod I think we should remove this MATLAB script and direct users to get their local Mef-File via CMake |
Beta Was this translation helpful? Give feedback.
-
Hi @MasterNomi, Indeed the cd $JSBSIM_SOURCE_ROOT_DIRECTORY
mkdir build
cd build
cmake -DBUILD_MATLAB_SFUNCTION=ON .. However if you cannot or do not want to use CMake, you can build |
Beta Was this translation helpful? Give feedback.
Hi @MasterNomi,
Indeed the
JSBSim.lib
file that you get from the Windows installer has been compiled with VS 2019 so it's likely that the binary is not compatible with earlier versions of MSVC. This can be worked around by using CMake as @agodemar suggested. For that, you will need to download the source code of JSBSim v1.2 which is the current stable branch. Once the files are unzipped, you can execute the following commands in a terminalHowever if you cannot or do not want to use CMake, you can build
JSBSim.lib
from scratch with VS 2015. For that, you can open the MSVC projectJSBSim.vcxproj
(it …