error LNK2019 Assistance Please :)

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • error LNK2019 Assistance Please :)

      Source Code

      1. 2>TeapotWars.obj : error LNK2019: unresolved external symbol "public: void __thiscall TeapotWars::EnvironmentLoadedDelegate(class std::tr1::shared_ptr<class IEventData>)"
      2. (?EnvironmentLoadedDelegate@TeapotWarsLogic@@QAEXV?$shared_ptr@VIEventData@@@tr1@std@@@Z) referenced in function "private: void __thiscall TeapotWarsLogic::RegisterAllDelegates(void)" (?RegisterAllDelegates@TeapotWarsLogic@@AAEXXZ)


      I've done a great deal of Google searching and have read about various 2019 errors. After a few hours of trying on my own I wanted to see if anyone would be willing to chime in. I really would like to fully understand what is causing the error.

      I did the verbose output for the compile but it was able to locate all of the libs.

      FYI: I started a brand new solution and added all of the files to it, setup the build configurations from scratch just to learn more about the IDE.. I know I may have missed something but I'm going cross eyed right now! :)
      You may call me char 71 97 100 100 97 109.
    • These are called "Linker Errors", it is done after compile time at the linking stage, basically one object file references a function in a header, say FileA.cpp includes FileB.h , if the function used from FileB.h is only a prototype or unimplemented member function, you need to implement it elsewhere, I always do this by defining a class definition in a header, and implementing it's functions in a cpp file.

      Basically what is happening here is,
      The function TeapotWarsLogic::RegisterAllDelegates is calling TeapotWars::EnvironmentLoadedDelegate , the function definition IS found otherwise you would get syntax error that the function has not been declared, however the function implementation IS NOT being found, these are found in different ways, either there is a cpp file in the same project that contains the function implementation, OR the function is implemented in a static or dynamic library which is linked in.

      What I would check as I know GCC uses a library for its engine, is to be sure that your TeapotWarsLogic project is linking to the GCC Engine's library.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • I checked out the include directory, and everything appears to be setup normal. I even have it set to build GCC first then build TeaPotWars as it should be since it's a build dependency.

      I'll have a fresh look at this right now and see if I can resolve the issue, that's the only thing standing in my way and a start to finish fresh project that I setup on my own(minus the help here).. the satisfaction awaits!
      You may call me char 71 97 100 100 97 109.
    • I'm back.. success!

      That actually helped me out, I guess I was extremely tired last night and should have just walked away.

      I found that I was indeed missing the implementation, so I added it where it belonged and everything is happy now, including me.
      You may call me char 71 97 100 100 97 109.