I have been trying to build DLL in MS C++ using extern "C".
Here is my simple code:
/* extern "C" */^M
extern "C" _declspec(dllexport) void calc1(float,float);^M
void calc1(float x,float y)^M
/* test subroutine for building library */^M
z= x + y;^M
printf("x=%.2f y=%.2f z=%.2f\n",x,y,z);^M
/* end calc1 */^M
I just want to compile this in command line mode.
To compile from command line, we used^M
cl -c calc1.c^M
We get the following error message:^M
calc1.c(5) : error C2059: syntax error : 'string'^M
Why is this happening? What am I doing wrong?