Lemonbonbon
Lemonbonbon

Reputation: 748

Specify include-path and library-files for code generation in Simulink Coder

This drives my crazy: I have a simulink model with an s-function generated by the s-function builder. I use some external header and library files (lib/dll) and all works in simulink-normal-mode.

But if I try to run my model in rapid accelerator or try to build the model for code generation I get LNK2019 errors. It seems that for code generation, Simulink does not know about my header-files (include folder) and my lib-files (folder and files) anymore. But I did specify all of these within the mex command for my s-function. Otherwise, the model wouldnt work in normal-mode.

Is there something I did miss that I should do for code generation?

Upvotes: 0

Views: 1826

Answers (1)

mzurawski
mzurawski

Reputation: 21

With the Microsoft compiler setup I have found it to be very troublesome and causing this error not due to my setup in Matlab, but due to the installation of the MSVC components:

  1. Need to remove the following two packages first (Must Do, Very Crucial) Microsoft Visual C++ 2010 Redistributable -x64 Microsoft Visual C++ 2010 Redistributable -x86
  2. Remove the current .NET framework and install an older version or not
  3. Install the Microsoft SDK 7.1 and this process may take a little bit time
  4. Make sure that the PC has one of the following installed
    • Microsoft C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
    • Visual Studio 2010 Professional or Express

Upvotes: 1

Related Questions