Question

I looked for similar problems, but the only topic might be the one on the use of a library, which I would avoid... here is my issue, I get this error:

1>Signal generator.obj : error LNK2001: unresolved external symbol "double __cdecl findMaxModulus(double *,int)" (?findMaxModulus@@YANPANH@Z)

I am using visual studio professional 2008 to develop a c program. I have a main file and another file with all the functions I wrote, myFunctions.h/c. The problem is that these errors do not come out when I include "myFunctions.c", while they come out when I include "myFunctions.h".

i am doing what i remember from university (i am much more into matlab now), which is

/* Home-made includes */
#include "myType.h"
#include "myFunctions.h"

just after the inclusion of the othe headers (stdlib, math, etc...)

any guess? thank you

Was it helpful?

Solution

The error means the linker could not find the function. This most likely means that you aren't compiling your myFunctions.c file at all. Make sure it's added as a "source file" to the project in Visual Studio.

OTHER TIPS

If you want to try on gcc try to compile both .c files same like this below:

gcc -Wall main.c myfunction.c -o final.out

You are missing the other .c file.So in the linking phase linker could not resolve the external symbol (which is your function). Try as I said.

For Visual Studio: You need to check whether all the source files are checked to make a build. there is an option to include number of files from the several source files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top