04-03-2007, 05:38
|
|
|
חבר מתאריך: 20.07.02
הודעות: 1,568
|
|
שגיאה עם CYGWIN בהרצה של תוכנה ב-C++...
ובכן, השגיאה איך שמצאתי נובעת אחרי שאני מגדיר משתנה חדש מסוג קלאס שיצרתי. לאחר ההגדרה וההרצה של התוכנית, לאחר שהתוכנית עושה מה שצריך, בסוף מופיעה השגיאה הבאה:
קוד:
5 [sig] a 2992 D:\cygwin\...(הכתובת של הקובץ): *** fatal error - called with threadlist_ix -1
ההגדרה של הקלאס ארוכה, לכן אני אצרף את הקוד של הקונסטרקטור ועוד כמה דברים שאולי בגללם הבעיה כי האחרים אני בטוח שזה לא הבעיה. או אולי זו בעצם בעיה ב-CYGWIN עצמו..
קוד:
class studentDB {
private:
studentRecord *_arrayDB[MAX_NUM_OF_STUDENTS];
int _next_index;
int probesCount;
void cpy(studentRecord *src, studentRecord *dest);
public:
// the default constructor, creates an empty database.
studentDB();
// the destructor, deletes all the records in the database.
~studentDB();
.
.
.
קוד:
#include <iostream>
using namespace std;
#include "arrayDB.h"
studentDB::studentDB()
{
for (int i=0; i<MAX_NUM_OF_STUDENTS; i++)
_arrayDB[i]=new studentRecord;
_next_index=0;
probesCount=0;
}
studentDB::~studentDB()
{
delete [] _arrayDB;
}
אה, ועוד הגדרה של STUDENTRECORD אם צריך:
קוד:
class studentRecord {
private:
unsigned int studentNumber;
string _firstName;
string _lastName;
unsigned int marks[NUM_OF_MARKS];
public:
// the default constructor
studentRecord();
// the destructor
~studentRecord();
.
.
.
|