i was trying to learn matlab to C workflow and i used a matlab coder to generate C/C++ code from this .m file
function c = simpleProduct(a,b) %#codegen
c=a*b;
and after the code has been generated my visual win32 c++ project looks like this.
#include <iostream>
#include "simpleProduct.h" //matlab generated header file.
using namespace std;
void main(){
cout<<simpleProduct(34,55); //matlab generated funcion
}
i even configured "addition library" and "additional dependency" from project properties to my generated static library but the same problem occurs again and again.
and from this code i generated a static library. and the operation is success on matlab. but when i included the generated header file and linked the static library inside visual studio and compiled it it gives me this error.
Error 1 error LNK2019: unresolved external symbol "float __cdecl simpleProduct(float,float)" (?simpleProduct@@YAMMM@Z) referenced in function _main C:\Users\serakpc\Documents\Visual Studio 2010\Projects\chiraq\chiraq\source.obj chiraq
development environments---- Matlab 2012b, Visual Studio 2012, Visual Studio 2010,
real32_T simpleProduct(real32_T a, real32_T b) { return a * b; }
– Serak Shiferaw