0

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

Daniel Daranas
  • 22,454
  • 9
  • 63
  • 116
NicTesla
  • 1,626
  • 5
  • 21
  • 35

1 Answers1

1

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.

Michael Burr
  • 333,147
  • 50
  • 533
  • 760
  • Thx, you lead me in the right direction. All i needed to do was to implement the class information. Because i do also program in c# and java i didn't realize, that i needed to implement a class always in a cpp file. Thanks for your help! – NicTesla Feb 11 '13 at 00:35