Error when compiling again...

  • bowserinator
    20th Oct 2014 Member 0 Permalink

    Yeah.. when I compile it without adding anything it works perfectly... but when I add an element it throws the following errors:

    • Error    2    error LNK2019: unresolved external symbol "public: __thiscall Element_NEMR::Element_NEMR(void)" (??0Element_NEMR@@QAE@XZ) referenced in function "class std::vector<class Element,class std::allocator<class Element> > __cdecl GetElements(void)" (?GetElements@@YA?AV?$vector@VElement@@V?$allocator@VElement@@@std@@@std@@XZ)    The-Powder-Toy-develop-2\Bowserinator's mod\The-Powder-Toy-master - Copy\ElementClasses.obj    tpt++
    • Error    3    error LNK2019: unresolved external symbol "public: virtual __thiscall Element_NEMR::~Element_NEMR(void)" (??1Element_NEMR@@UAE@XZ) referenced in function "class std::vector<class Element,class std::allocator<class Element> > __cdecl GetElements(void)" (?GetElements@@YA?AV?$vector@VElement@@V?$allocator@VElement@@@std@@@std@@XZ)    The-Powder-Toy-develop-2\Bowserinator's mod\The-Powder-Toy-master - Copy\ElementClasses.obj    tpt++

    Error    4    error LNK1120: 2 unresolved externals    The-Powder-Toy-develop-2\Bowserinator's mod\The-Powder-Toy-master - Copy\Debug\tpt++.exe    1    1    tpt++

     

    Idk why I ran generator.py correctly.

  • jacob1
    20th Oct 2014 Developer 0 Permalink
    Did you add the correct directive comments in NEMR.cpp? It should look something like this:

    //#TPT-Directive ElementClass Element_NEMR PT_NEMR 179
    //#TPT-Directive ElementHeader Element_NEMR static int update(UPDATE_FUNC_ARGS)
  • bowserinator
    20th Oct 2014 Member 0 Permalink

    Yeah I did

  • jacob1
    20th Oct 2014 Developer 0 Permalink
    Oh I misread the error. If you are compiling in visual studio you have to add NEMR.cpp to the solution so that it can find the code. How to do that is described in step one here: https://powdertoy.co.uk/Wiki/W/Coding-tutorial.html
  • bowserinator
    20th Oct 2014 Member 0 Permalink

    Thanks so much!