I have tried a number of different things to try and get the wrapper.cpp file included into the source_files listed in the .mk (make) file, rather than it being skipped. This has included editing the rtwmakecfg and trying to find the toolchain that is used to compile the .mk file. Editing the rtwmakecfg was unsuccessful. I did edit a Linux tool chain located in the "coder" directory. But I don't think it is the one that is used. The toolchain that is listed in the .mk file I cannot find - gmake, LinuxRemoteBuild.
I have been trying again to get the MPU6050/HMC5883L model to build on the RPi. In the make file (.mk) which is included in the (_rtt) folder, when I rename the _wrapper.cpp file it is listed as a "SKIPPED_FILE". When I do not rename the wrapper.c is included in the "SOURCE_FILES". I have tried to get it included by editing the SFB.mat file but still no luck.
Many thanks for your reply. I should explain more. I am trying to incorporate the libraries for the MPU6050 and HMC5883L. The code I have previously compiled on the PI. I used the Arduino MPU6050 S-Function Builder Example from Joshua Hurst as a Starting point and replaced the Arduino Libraries with the Libraries I have for the PI - including the I2Cdev. The S-function builds successfully. I then change the _wrapper from .c to .cpp and apply the extern "C" changes. However, when I run on target hardware - using the MATLAB Pi Support Package - it does not include the wrapper .cpp or any .cpp file in the folder (_rtt) it downloads to the PI to compile and run. If I leave the wrapper.c unchanged it does get incorporated into the _rtt folder but then I have unreferenced .cpp files not included.
I am trying build a model incorporating an S-Function Builder for my RaspPi. Because it includes C++ files I change the wrapper file extension to .cpp and at extern "C" infront of the Outputs and Update wrapper. However, when I run the model a further file is built with the extension _rtt and it does not include my wrapper file and other .cpp files within the file that gets downloaded to the RaspPi, hence I get undefined references.
I have tried a number of things but starting to go around in circles.