1

When I run "make helper," the following error comes up: "undefined reference to `main'" and "linker command failed with exit code 1"

What am I doing wrong?? thank you in advance!!

    void grayscale(int height, int width, RGBTRIPLE image[height][width]){
    int avg_rgb;
    for (int i = 0; i < height; i ++)
    {
        for (int j = 0; j < width; j ++)
        {
            avg_rgb = round(((float)image[i][j].rgbtBlue + (float)image[i][j].rgbtGreen + (float)image[i][j].rgbtRed) / 3);
            image[i][j].rgbtBlue = avg_rgb;
            image[i][j].rgbtGreen = avg_rgb;
            image[i][j].rgbtRed = avg_rgb;
        }
    }
    return;
}
1

The command is make filter

There are two source files, filter.c and helpers.c. The executable is named filter.

2
  • but isn't that for the general code? I still have to compile "helpers" in order to make "filters" run successfully. also, when i ran "make filter," it said "Could not open infile.bmp."
    – Cathy Choo
    May 31 at 13:07
  • @CathyChoo That sounds like an error message you get from running filter, not from compiling it. May 31 at 15:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .