undefined symbol

Started by
3 comments, last by irreversible 7 years, 9 months ago

Hi

why do I get:

undefined symbol: _ZN9AusfaelleC1Eii

with this header:

/*
* myList.h
*
* Created on: Jul 3, 2016
* Author: michael
*/

#ifndef MYLIST_H_
#define MYLIST_H_


class Ausfaelle {
public:
int active, color;
Ausfaelle(int active, int color);
};

int mListe ();

#endif /* MYLIST_H_ */

and in main.cpp:

int mListe ()
{
std::list<Ausfaelle> points;

points.push_back(Ausfaelle(1,1));

std::list<Ausfaelle>::iterator iter;

for(iter = points.begin(); iter != points.end(); ++iter)
{
Ausfaelle test = *iter;
std::string s = std::to_string(test.active);
char const *pchar = s.c_str();
XPLMDebugString(pchar);
}

return 0;
}

Many thanks

Advertisement

Where is the code for the Ausfaelle class? You only have the definition shown.

I'm assuming he doesn't have a 'definition' which is the cause of the error.

class Ausfaelle 
{
public:
    int active, color;
    Ausfaelle(int _active, int _color) : active(_active), color(_color) 
    {
    }
};

Thanks, forgot this.

Ausfaelle::Ausfaelle(int a, int b) {
active = a;
color = b;
}

Are you including the header in main.cpp?

This topic is closed to new replies.

Advertisement