Toon posts:

[Qt] compile errors

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik heb onlangs het boek "C++ GUI Programming with Qt 3" aangeschaft en heb eindelijk de tijd gevonden om er aan te beginnen. Ben nu dus gewoon alle voorbeelden uit het boek aan het doorlopen. Ik heb weinig kennis van C++, maar met mn kennis van C en JAVA kom ik er wel redelijk uit.

Maar bij Hoofdstuk 3 loop ik al tegen een compile error aan. Het betreft hier een voorbeeld uit het boek en ik kan nergens vinden waarom ie niet zou compilen:

C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
void Spreadsheet::sort(const SpreadsheetCompare &compare)
{
    vector<QStringList> rows;
    QTableSelection sel = selection();
    int i;
    
    for (i = 0; i < sel.numRows(); ++i) {
        QStringList row;
        for (int j = 0; j < sel.numCols(); ++j)
            row.push_back(formula(sel.topRow() + i,
                                  sel.leftCol() + j));
        rows.push_back(row);
    }

    stable_sort(rows.begin(), rows.end(), compare);
    
    for (i = 0; i < sel.numRows(); ++i) {
        for (int j = 0; j < sel.numCols(); ++j)
            setFormula(sel.topRow() + i, sel.leftCol() + j,
                       rows[i][j]);
    }

    clearSelection();
    somethingChanged();
}


zonder regel 12 compiled ie wel, maar dan werkt de applicatie uiteraard niet. Ik zie de fout echt niet. rows is immers een vector die QStringLists bewaart en row(welke in regel 12 aan de vector toegevoegd wordt) is een QStringList.

errors:
code:
1
2
3
4
spreadsheet.cpp:
Error E2263 C:\Borland\Bcc55\include\vector.cc 135: Exception handling not enabled in function vector<QStringList,allocator<QStringList> >::__insert_aux(QStringList *,const QStringList &)
Error E2451 C:\Borland\Bcc55\include\vector.cc 148: Undefined symbol 'tmp_size' in function vector<QStringList,allocator<QStringList> >::__insert_aux(QStringList *,const QStringList &)
Error E2263 C:\Borland\Bcc55\include\memory.stl 726: Exception handling not enabled in function uninitialized_copy<QStringList *,QStringList *>(QStringList *,QStringList *,QStringList *)


Bij het boek zat overigens een cd waarop de borland compiler stond en Qt, dus dit is allemaal wel goed geinstalleerd.

  • MSalters
  • Registratie: Juni 2001
  • Laatst online: 09-04 22:08
De error kan niet helderder? Je exception handling staat uit. Dat is een vlaggetje op de command line van je compiler, weet van Borland niet zo gauw welke.

Man hopes. Genius creates. Ralph Waldo Emerson
Never worry about theory as long as the machinery does what it's supposed to do. R. A. Heinlein