Hello, I am getting a linked error when I changed file name to cpp. 1>main.obj : error LNK2019: unresolved external symbol "void __cdecl func_name(double * *,int,int,int,double * *,double * *,double * *,double * *)" I am using objects in my new code but this function which was there earlier is triggering this error.How do I handle it? Someone please let me know.

I changed the include file name from .c to .cpp but now I get different errors. I get this
error C2664: 'func_name2' : cannot convert parameter 4 from 'scal (__cdecl *)(scal,scal)' to 'scal (__cdecl *)(void)'

what shall I do?

The follwoing is the function definition

void mat_apply_fx(mat M, int rows, int cols, scal (*fx)(void *), scal par)
{
    int i,j;

    for (i=0; i<rows; i++)
        for (j=0; j<cols; j++)
            M[i][j] = (*fx)(M[i][j], par);
}

the following is the call
mat_apply_fx(W, rows, rows, fx_rand(), 0);

Could some one tell me how to fix this error. Surely renaming the file from c to cpp did some thing (may be it added extra rules on how functions can be prototyped).

It seems your code has defined the function pointer that returns scal has no matching version that takes a void* argument. Post the function declarations that may be relevant.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.