Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Unicode::Text::Text problem with Qt?  (Read 1844 times)

0 Members and 1 Guest are viewing this topic.

wasabi

  • Newbie
  • *
  • Posts: 23
    • View Profile
sf::Unicode::Text::Text problem with Qt?
« on: September 10, 2010, 07:14:51 pm »
After a good time away from it, I'm back on my Qt / SFML program and have progressed far faster than I'd imagined, but now I have a problem with sf::String::SetText().

Code: [Select]
class MyCanvas : public QSFMLCanvas
{
Q_OBJECT
public :
MyCanvas(QWidget* Parent, const QPoint& Position, const QSize& Size);
MyCanvas();
public slots:
void OpenFile(QString str);
private :
        QFile pl;
        QTextStream _pl;
sf::View CurrentView;
sf::View GlobalView;
Point MouseCoords;
std::vector<Line> faults;  
std::vector<Line> horizons;
std::vector<Point> points;  
void ChangeView_Key();
void ChangeView_Pan(QMouseEvent* e);
void DesignFault();
void DesignLine(Point pt1, Point pt2);
    Line* NewLine();
void OnInit();
    void OnUpdate();
void SaveFaultPoints(int elevation,int n);
void SaveFaultSegments();
protected:
void keyPressEvent(QKeyEvent* e);
void mouseMoveEvent(QMouseEvent* e);
void mousePressEvent(QMouseEvent* e);
void wheelEvent(QWheelEvent* e);
};

void MyCanvas::OnUpdate()
{
    std::string coords("(");
    sf::String Coords;
    char coord[16];
    //Clear();
    sprintf_s(coord,16,"%.0f",MouseCoords.coord.x);
    coords+= coord;
    coords+= ",";
    sprintf_s(coord,16,"%.0f",MouseCoords.coord.y);
    coords+= coord;
    coords+= ")";
    Coords.SetFont(sf::Font::GetDefaultFont());
    Coords.SetSize(30.f);
    Coords.SetText(coords);
    Clear();
    for(std::vector<Line>::iterator it=faults.begin();it<faults.end();it++)
        Draw(it->shape);
    for(std::vector<Point>::iterator it=points.begin();it<points.end();it++)
        Draw(it->shape);
    for(std::vector<Line>::iterator it=horizons.begin();it<horizons.end();it++)
        Draw(it->shape);
    SetView(GetDefaultView());
    SetView(CurrentView);
    Display();
}


Should I try to compile it, however, I get the following error:
Code: [Select]
1>MyCanvas.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Unicode::Text::Text(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Text@Unicode@sf@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: virtual void __thiscall MyCanvas::OnUpdate(void)" (?OnUpdate@MyCanvas@@EAEXXZ)
1>debug\QT.exe : fatal error LNK1120: 1 unresolved externals


However, if I comment out the .SetText() command, it compiles correctly.

 

anything