#include "types.h"
#include "gaussian.h"
#include "args.h"
#include <stdbool.h>
int main ( int argc, char *argv[] )
{
double units;
uint32_t gaussianSize;
float gaussianSigma;
char* imgname;//the name of the image file, taken by the arguments
//read in the program's arguments
if(readArguments(argc,argv,&imgname,&gaussianSize,&gaussianSigma)==false)
return -1;
//perform CPU blurring
if(pna_blur_cpu(imgname,gaussianSize,gaussianSigma)==false)//time it
return -2;
//perform GPU blurring and then read the timer
if(pna_blur_gpu(imgname,gaussianSize,gaussianSigma)==false)
return -3;
return 0;
}
I have errors of undefined reference for functions
readArguments declared in args.h
pna_blur_cpu declared in gaussian.h
pna_blur_gpu declared in gaussian.h
can you tell me why?
Wow, I did not noticed that. I had no idea it could be the reason. That's the file I
originally created and copied code into it, instead of copy the original file as main.c . This was the error.
I yet removed two lines of C++ and it looked compiled, but program crashes after run. But never mind. I just wanted to remove this error. I already have updated version of the program which works. Thanks for help.
> Try mucking up gaussian.c.
> Then try rebuilding. If you don't get a compiler error, you know the file is not being linked.
Or you could read the build command
> Instead, you would have got: undefined reference to `_pna_blur_cpu'
¿why would it add an underscore?
Don't ask me; ask the people who wrote the linker which emitted the symbol verbatim.
Note: It does not 'add an underscore'; the underscore is there in the symbol given to the linker. Some linkers 'remove the leading underscore' when they format the diagnostic; some others do not.