Errors when building program

This is a discussion on Errors when building program within the C Programming forums, part of the General Programming Boards category; Hi all, Had a program that worked and compiled correctly and have since added the following function. int point() { ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    8

    Angry Errors when building program

    Hi all,

    Had a program that worked and compiled correctly and have since added the following function.

    int point()
    {
    FILE *pp;
    int findpoint=0, linepoint=1;
    char pointstemp[256];
    char pointsfilename[25];
    char pointsword[25];

    printf("Please enter file name: ");
    scanf("%s", pointsfilename);

    printf("Please enter word: ");
    scanf("%s", pointsword);

    if ((pp = fopen(pointsfilename, "r")) == NULL)
    return(-1);

    while( fgets(pointstemp, 256, pp) != NULL)
    {
    if ((strstr(pointstemp, pointsword)) !=NULL)
    {
    printf("Points are %d", linepoint);
    printf("%s", pointstemp);
    findpoint++;
    }

    linepoint++;
    }

    if (findpoint == 0)
    {
    printf("\nNo match found.\n");
    }

    menu();

    return 0;
    }

    The program complies with no errors or warnings (using Microsoft Visual Studio) but when i try to build the program the following errors occur!

    Linking...
    8.obj : error LNK2001: unresolved external symbol _points
    Debug/8.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    8.exe - 2 error(s), 0 warning(s)

    Does anybody have any ideas why this is?

    Many thanks in advance.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Does anybody have any ideas why this is?
    Without a more useful example of your problem, I would guess that you named the function point, but actually called points.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    8

    All sorted now

    Thanks very much for the help.

    A very simple problem that has now been sorted. Couldn't see the wood for the trees!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 01:27 PM
  2. mega compile errors for small program
    By s_UNI_ in forum C++ Programming
    Replies: 4
    Last Post: 04-28-2005, 01:00 PM
  3. Errors with program
    By nizbit in forum C Programming
    Replies: 37
    Last Post: 12-19-2004, 09:56 PM
  4. Average Rainfall Program Errors
    By JamesAnthony23 in forum C Programming
    Replies: 1
    Last Post: 09-11-2002, 11:44 PM
  5. I'm a newbie and I can't understand the errors in my program
    By iluvmyafboys in forum C++ Programming
    Replies: 19
    Last Post: 02-20-2002, 10:40 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21