Thread: annoying lil bug

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    annoying lil bug

    what the heck is an unresolved external?

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    usually a serious error resulting the code not to finish compiling....any code?

  3. #3
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    posty some code and a copy of the error...use code tags.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Usually appears when you've included a header but not linked the libraries.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    3
    the code is from the marine biology case study heres my main (whats a code tag?)

    #include <iostream.h>
    #include <fstream.h>
    #include <apstring.h>
    #include "environ.h"
    #include "display.h"
    #include "simulate.h"
    #include "nbrhood.h"
    #include "position.h"
    #include "utils.h"

    int main()
    {
    // replace filename below with appropriate file (full path if necessary)
    ifstream input("C:\\My Documents\\Programs\\fish.txt");
    Environment env(input);

    // Display display(100,100); // for graphics display
    Display display; // for text display
    apstring s;

    Simulation sim;

    int step;
    int numSteps;

    display.Show(env);

    cout << "--- initialized --- " << endl;

    cout << "How many steps? ";
    cin >> numSteps;
    getline(cin, s);

    for (step = 0; step < numSteps; step++)
    {
    sim.Step(env);
    display.Show(env);
    cout << " step " << step << " (press return)";
    getline(cin, s);
    }

    return 0;
    }

    fishsim.obj : error LNK2001: unresolved external symbol "public: void __thiscall Simulation::Step(class Environment &)" (?Step@Simulation@@QAEXAAVEnvironment@@@Z)

    fishsim.obj : error LNK2001: unresolved external symbol "public: void __thiscall Display::Show(class Environment const &)" (?Show@Display@@QAEXABVEnvironment@@@Z)

    fishsim.obj : error LNK2001: unresolved external symbol "public: __thiscall Simulation::Simulation(void)" (??0Simulation@@QAE@XZ)

    fishsim.obj : error LNK2001: unresolved external symbol "public: __thiscall Display:isplay(void)" (??0Display@@QAE@XZ)

    fishsim.obj : error LNK2001: unresolved external symbol "public: __thiscall Environment::Environment(class istream &)" (??

    0Environment@@QAE@AAVistream@@@Z)

    Debug/fishsim.exe : fatal error LNK1120: 5 unresolved externals

  6. #6
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    have you included the .cpp files into the project? the environ.cpp, simulate.cpp, display.cpp, etc. etc. ?

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    3
    lol thx it works now!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gaks bug?
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-31-2008, 02:47 PM
  2. ATL bug of CComPtr?
    By George2 in forum Windows Programming
    Replies: 6
    Last Post: 04-07-2008, 07:52 AM
  3. Annoying bug I can't find or fix!
    By homeyg in forum C++ Programming
    Replies: 3
    Last Post: 11-21-2004, 12:13 AM
  4. Annoying MSVC6 Std bug
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-03-2002, 03:04 PM
  5. wierdest (annoying) C++ bug
    By phantom in forum C++ Programming
    Replies: 3
    Last Post: 10-20-2001, 08:12 PM