Hi all,
I've got a VS 2010 project that makes some pretty standard typedefs like:
... and a function that looks like:
In my .c file (vector.c), I have a basic implementation:
So when I compile this, the compiler gives a ton of errors like:
ml_vector.c(5): error C2143: syntax error : missing ';' before 'type'
.. so it doesn't find the type properly. BUT if I change the extension of the file vector.c to .cpp, it works fine.
Is this some C syntax thing I'm forgetting? Thanks for any help.
I've got a VS 2010 project that makes some pretty standard typedefs like:
Code:
typedef int mlInt;
Code:
void mlVecMult(int length, int* vec1, int* vec2, int* vecOut);
Code:
void mlVecMult(mlInt length, mlInt* vec1, mlInt* vec2, mlInt* vecOut)
{
for(mlInt i=0; i < length; i++)
{
vecOut[i] = vec1[i] * vec2[i];
}
}
ml_vector.c(5): error C2143: syntax error : missing ';' before 'type'
.. so it doesn't find the type properly. BUT if I change the extension of the file vector.c to .cpp, it works fine.
Is this some C syntax thing I'm forgetting? Thanks for any help.
Comment