Thread: What's an "unresolved external"

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    20

    What's an "unresolved external"

    What is it?

    Is there a site of book that lists errors and the meanings behind them? I'm using bcc55, comandline. Thanx again

  2. #2
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    it means the compiler can't find it. usually it's spelling error, misuse of a function, missing header or something like that.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    20
    I think I figured it out? (It runs anway). But if I can ask a follow up. Why, when you call a function w/ an array as input, do you not specify an offset, but when you define the function you have to write the offset in?

    Here's the code, look for the ????

    main()
    {
    struct planet system[max];//intlz array type struct planet
    int loop1;//control
    for(loop1=0;loop1<max;loop1++)//gather multi entries
    {
    system[loop1]=f_gather_data();//f_gather_data call
    }
    cout<<endl;
    f_show_data(system);//????
    return (0);

    }


    void f_show_data(struct planet data[max])//?????
    {
    int loop2;
    cout<<tab<<tab<<"Planet"<<tab<<"Distance"<<endl;
    for(loop2=0;loop2<max;loop2++)
    {
    cout<<tab<<tab<<data[loop2].name<<tab;
    cout<<data[loop2].distance<<endl;
    }
    cout<<endl;
    }

  4. #4
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    You don't need to and you shouldn't.
    Secondly, you're using C++ so you don't need the struct identifier infront of your planet type declarations, that's a C thing.

    The function prototype should look like this:
    Code:
    void f_show_data( planet data[] );
    What you are passing is actually a pointer to a block of memory so it could also be written like this:
    Code:
    void f_show_data( planet *data );
    The name of the array is actually a pointer to the first index of the array. The [] allow you to get a value from a specific index without having to use pointer notation to get to it.

    And use code tags when posting or an attachment if it's large.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 04-27-2006, 10:39 AM
  2. The Dreaded "Unresolved External Symbol" :-(
    By DrMario in forum C++ Programming
    Replies: 2
    Last Post: 03-25-2005, 01:43 AM
  3. Ask about these "unresolved external symbol" error
    By ooosawaddee3 in forum C++ Programming
    Replies: 1
    Last Post: 06-29-2002, 11:39 AM