hans
hans

Reputation: 5

Including c libraries in the custome code section of Simulink

I'm trying to include Csparse from SuiteSparse in to Simulink.
I've included the header ch.h and the directory of the c-functions in the custom code section.
If I call the function cs_compress over code.ceval I get this error:

cs_compress.obj : error LNK2019: unresolved external symbol cs_spalloc referenced in function cs_compress 
Test2_sfun.mexw64 : fatal error LNK1120: 1 unresolved externals 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.exe"' : return code '0x460' 
Stop.

The function cs_spalloc I presume is called from a library since there exists no cs_spalloc.c. The function is however defined in the header file as:

cs *cs_spalloc (csi m, csi n, csi nzmax, csi values, csi triplet) ;

Am I right to presume it is called from a library? And if so where do I find the library in a format to include in to the custom code section in Simulink?

Upvotes: 0

Views: 409

Answers (1)

hans
hans

Reputation: 5

I found the c- functions cs_spalloc online, and just copyed it. Now it works.

Upvotes: 0

Related Questions