Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

linking problems when compiling c++ s-function

$
0
0
Hello everybody,
I am trying to create a c++ s-function. I have sensors that work perfectly in Visual Studio, but I would like to import them in Simulink.
So I adjusted the c++ code in a way that is compatible with the S-function template, but I have problems when I try to compile the file in Matlab.
In the command window I wrote :

mex imu_simulink.cpp ThreeSpace_API.lib

The error that results is the following: "
Creating library C:\Users\Seven\AppData\Local\Temp\mex_STIHED\templib.x and object C:\Users\Seven\AppData\Local\Temp\mex_STIHED\templib.exp

imu_simulink.obj : error LNK2019: unresolved external symbol tss_startStreaming referenced in function "public: void __cdecl TSSController::StartCollectingData(void)" (?StartCollectingData@TSSController@@QEAAXXZ)

 tss_startStreaming is a function that is defined in the .lib file

The file.lib is in the same folder of the file.cpp, and I have tried to use the -l option of mex :
mex imu_simulink.cpp -lThreeSpace_API

but the problem is still there!

How can I solve this linking problem?
Thanks in advance
Camilla

Viewing all articles
Browse latest Browse all 19628

Trending Articles