Search code examples
c++compiler-errorsmosync

Compiler Error __ZTVN13..6..E


I'm currently struggeling with a compilerproblem. The problem is, that i use one of the MoSync example apps called "European Countries" (written in c++) to write my own. But when i compile the modified code, it gives me following error in response:

Controller.cpp:24: Error: Unresolved symbol '__ZTVN13Flightmanager6FlightE',

I already had a look at the example several times and i already copied the code from the example to mine, but it doesn't solve any problems. In paticutlar i might understand what the error means (i do have c experience), but i've never seen such structured error. I also looked at namespacing conventions but there shouldn't be any problems.

//Flight.h

namespace Flightmanager
{

class Flight
{
    public:

    static int flightCounter;

    /**
     * The constructor creates the user interface.
     */

    Flight(char *flightnumber, char *gate, char *departure, char *additionalinfo, char *destinationairport, char *destinationairportshort) {

        this->_id = flightCounter;
        flightCounter ++;

        this->_flightnumber = flightnumber;
        this->_gate = gate;
        this->_departure = departure;
        this->_additionalinfo = additionalinfo;
        this->_destinationairport = destinationairport;
        this->_destinationairportshort = destinationairportshort;
    }

    virtual ~Flight();
}

//Controller.h

#include [all other includes]
#include "../Model/Flight.h"

namespace Flightmanager
    {
        Controller::Controller():
                mFlightArray(NULL),
                mCurrentlyShownScreen(NULL)
    {
    initScreenSizeConstants();
    initPlatformType();

//error: Unresolved symbol '__TZVN13Flightmanager6FlightE'.
        initData();
//error: Unresoled symbol '__TZVN13Flightmanager6Flight13flightCounterE'.
        mFlightTableView = new TableViewController(*this);//error: Unresoled symbol '__TZVN13Flightmanager6Flight13flightCounterE'.
        mFlightDetailView = new DetailViewController();
        }
    }

I use MoSync Version 3.2 Build date: 121219-1556

Thx


Solution

  • You need to link in something that has definitions for:

    Flight::flightCounter
    
    Flight::~Flight()
    

    whether that's a .o object file for Flight.cpp (or some source file) or a library depends on your project.