Προς το περιεχόμενο

C++ Compiler Error


Dvs

Προτεινόμενες αναρτήσεις

Δημοσ.

Prospatho na ftiaxo merikes klaseis stin C++ kai perno to exis error:

 

d:\output\main\main.cpp(43) : fatal error C1001: INTERNAL COMPILER ERROR

(compiler file 'msc1.cpp', line 1786)

Please choose the Technical Support command on the Visual C++

Help menu, or open the Technical Support help file for more information

Error executing cl.exe.

 

Main.exe - 1 error(s), 0 warning(s)

 

Ama vgalo to ";" stin grammi 43 tote o compiler petaei error ekei!

(ama afaireso to "int Employee::GetAge" tote ginetai compile kanonika (ennoeitai oti vgazo kai to minima sto programma")

 

O kodikas pou grafo einai autos:

 

/***************************************************************

File: main.cpp

 

Kefalaio 7 - oles mazi // selida 141

 

1. Dimiourgia klassis me to onoma "Employee"

2. Dimiourgia ton melon: age,yearsOfService,Salary

3. Dimiourgia public methodon gia tin allagi & anaktisi ton melon

4. Emfanisi ton stoixeion stin main ()

 

***************************************************************/

 

#include <iostream.h>

typedef unsigned short int USHORT;

typedef unsigned long int ULONG;

typedef short int SSHORT;

typedef long int SLONG;

 

class Employee

{

private:

 

ULONG itsAge;

ULONG itsYearsOfService;

ULONG itsSalary;

 

public:

 

SetAge(int age) ; // Set Age

int GetAge() const;

 

SetYearsOfService(int YearsOfService);

int GetYearsOfService() const; // Set YearsOfService

 

SetSalary(int Salary);

int GetSalary() const; // Set Salary

};

 

Employee::SetAge ( int age)

{

itsAge =age;

};

 

int Employee::GetAge

{

return itsAge;

}

void main()

{

 

Employee x;

x.SetAge (5);

cout << "Ilikia: " << x.GetAge ;

 

}

 

<small>[ 06-10-2002, 16:09: Το μήνυμα επεξεργάστηκε από: Dvs ]</small>

Δημοσ.

Ρίξε μία ματιά εδώ:

 

http://search.support.microsoft.com/search/default.aspx?Catalog=LCID%3D1033%26CDID%3DEN-US-KB%26PRODLISTSRC%3DON&Product=&KeywordType=ALL&Titles=false&numDays=&maxResults=25&within Results=&Queryl=1786+c1001&Query=1786+c1001&QuerySource=gsfxSearch_Query

 

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q195738

 

και επίσης κατέβασε το τελευταίο service pack για τη VC++ από: http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp

 

και ίσως να θέλεις να χρησιμοποιήσεις και τη using namespace std;

Δημοσ.

Euxaristo girioni!

Xrisimopoio tis exis parametrous:

 

/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/Main.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c

 

Ama valo sto telos to "/Zm#1000" mou petaei to error:

 

Compiling...

Command line error D2004 : '/Zm' requires an argument

Error executing cl.exe.

 

I .NET [i VC++ panta] exei diafores apo tin palia? (an kai den nomizo)

Δημοσ.

Evala kai /Zm1000 (auto einai to sosto) alla den douleuei!

Dokimasa kai tis times:

/Zm190000000

/Zm10000

/Zm900000

alla tipota <img border="0" title="" alt="[Frown]" src="images/icons/frown.gif" />

Δημοσ.

Re sy afou iparxoun lathi sidaktika kai paraleipsis den einai dinaton ta doulepsei.Px sto telos kaleis tin GetAge alla to dilwneis san melos metavliti-adikeimeno les cout << "Ilikia: " << x.GetAge; enw i GetAge den einai metavliti alla sinartisi melous[diladi methodos toy adikeimenou x] Tha prepei na einai diladi GetAge[]; akoma iparxoun paralipseis stis epistrofes twn sinartisewn px i SetAge[int age] tha prepei na einai tupou void.Parakatw sou parathetw ton kwdika poy leitourgei mia xara kai egeine compiled se Borland C++ 5.5

 

</font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">

#include <iostream.h>

typedef unsigned short int USHORT;

typedef unsigned long int ULONG;

typedef short int SSHORT;

typedef long int SLONG;

using namespace std;

 

class Employee

{

private:

ULONG itsAge;

ULONG itsYearsOfService;

ULONG itsSalary;

public:

void SetAge(int age) ; // Set Age

ULONG GetAge() const;

void SetYearsOfService(int YearsOfService);

ULONG GetYearsOfService() const; // Set YearsOfService

void SetSalary(int Salary);

ULONG GetSalary() const; // Set Salary

};

 

void Employee::SetAge(int age)

{

itsAge =age;

}

 

ULONG Employee::GetAge() const

{

return itsAge;

}

 

void Employee::SetYearsOfService(int YearsOfService)

{

itsYearsOfService=YearsOfService;

}

 

ULONG Employee::GetYearsOfService() const

{

return itsYearsOfService;

}

 

void Employee::SetSalary(int Salary)

{

itsSalary=Salary;

}

 

ULONG Employee::GetSalary() const

{

return itsSalary;

}

 

void main()

{

Employee x;

x.SetAge(5);

cout<<"Ilikia: "<<x.GetAge();

}[/code]</blockquote><font size="2" face="Verdana, Helvetica, sans-serif">Gia na xrisimopoieis ta adikeimena eisodou-exodou cin kai cout i kai alla adikeimena-metavlites klp poy einai orismena ston xoro onomasias std tha prepei na xrisimopoieis tin odigia using stin arxi...Tin exw valei panw panw[using namespace std;] se kathe alli periptwsi i prosvasi sta adikeimena auta ginete me ton telesti analisis emveleias :: diladi tha eprepe na grapseis std::cout<<...Auta enw mia kaliteri prosegisi tha borouse na ginei kai me tin xrisi sinartisewn kataskeuis kai katastrofis[constructors kai destructors] kai oxi sinartisewn set kai get.Telos tha borouses na min xrisimopoies ton palio [C] tropo gia tin ensomatwsi twn .h files [hearder files] kai na kaneis ta includes kateuthian #include <iostream>...Se kathe periptwsi kalo tha itan gia na min berdeuese na xwrizes tis klaseis sou apo to kirios programa sou vazodas ta adistoixa stimata kwdika sta adistoixa files px

</font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">

//file employee.h

class Employee

{

private:

ULONG itsAge;

ULONG itsYearsOfService;

ULONG itsSalary;

public:

void SetAge(int age) ; // Set Age

ULONG GetAge() const;

void SetYearsOfService(int YearsOfService);

ULONG GetYearsOfService() const; // Set YearsOfService

void SetSalary(int Salary);

ULONG GetSalary() const; // Set Salary

};[/code]</blockquote><font size="2" face="Verdana, Helvetica, sans-serif"></font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">

//file employee.cpp

#include "employee.h"

#include <iostream.h>

typedef unsigned short int USHORT;

typedef unsigned long int ULONG;

typedef short int SSHORT;

typedef long int SLONG;

using namespace std;

 

void Employee::SetAge(int age)

{

itsAge =age;

}

 

ULONG Employee::GetAge() const

{

return itsAge;

}

 

void Employee::SetYearsOfService(int YearsOfService)

{

itsYearsOfService=YearsOfService;

}

 

ULONG Employee::GetYearsOfService() const

{

return itsYearsOfService;

}

 

void Employee::SetSalary(int Salary)

{

itsSalary=Salary;

}

 

ULONG Employee::GetSalary() const

{

return itsSalary;

}[/code]</blockquote><font size="2" face="Verdana, Helvetica, sans-serif"></font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">

//file example.cpp

//Compile multiple source file example.cpp employee.cpp

void main()

{

Employee x;

x.SetAge(5);

cout<<"Ilikia: "<<x.GetAge();

}

 

or

 

int main(void)

{

Employee x;

x.SetAge(5);

cout<<"Ilikia: "<<x.GetAge();

retorn 0;//epistrofi sto leitourgiko toy akeraiou 0=ektelesi epitixis

}[/code]</blockquote><font size="2" face="Verdana, Helvetica, sans-serif">Auta kai pisteuw na se voithisa.Sto keimeno oi [] einai paretheseis alla eixa provlima me to post gi'auto tis egrapsa etsi.Ston kwdika einai ola ok.Ean xreiasteis kai kati allo edw eimai... <img border="0" title="" alt="[Wink]" src="images/icons/wink.gif" />

Δημοσ.

Nai to tip me to na xwrizes ta hearder files apo ton kwdika einai geniko gia na min vazeis orismous klasewn kai tis ilopoiseis toys(kwdikas) mazi.Oson afora to namespace einai poly vasiko ... sigekrimena einai xwros onomasias kai oxi vilviothiki i VC++ einai gia ta baza pados vale ta service packs apo ta parapanw poy protinei o filos girionis kai tha strwsei ligo i katastasi...tha exeis prob kai pio meta(edw den anagnorizei tis friend synartiseis!!!!! ti na peis tespa)---Dokimase Borland Compiler 5.5 kai tha vreis tin igia sou poly kaliteros sibagis mikros kai grogoros kwdikas.Auta <img border="0" title="" alt="[Wink]" src="images/icons/wink.gif" />

Δημοσ.

An kai legetai oti o compiler tis M$ ftiaxnei ton pio optimized kodika (diko tis leitourgiko einai -ti skata!)

 

Mipos i namespace einai gia C kai oxi gia C++?

Δημοσ.

Evala tin .net kai frikara - ti m*l*kia einai auti? mou evgale error se ola mou ta .h files!

 

</font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr /><font size="2" face="Verdana, Helvetica, sans-serif"> Se kathe periptwsi kalo tha itan gia na min berdeuese na xwrizes tis klaseis sou apo to kirios programa sou vazodas ta adistoixa stimata kwdika sta adistoixa files px</font><hr /></blockquote><font size="2" face="Verdana, Helvetica, sans-serif">Nai, alla olo to programma einai mia klassi .Den exei noima na kano kati tetoio <img border="0" title="" alt="[Wink]" src="images/icons/wink.gif" />

 

</font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr /><font size="2" face="Verdana, Helvetica, sans-serif"> Gia na xrisimopoieis ta adikeimena eisodou-exodou cin kai cout i kai alla adikeimena-metavlites klp poy einai orismena ston xoro onomasias std tha prepei na xrisimopoieis tin odigia using stin arxi...Tin exw valei panw panw(using namespace std;) se kathe alli periptwsi i prosvasi sta adikeimena auta ginete me ton telesti analisis emveleias :: diladi tha eprepe na grapseis std::cout<<... </font><hr /></blockquote><font size="2" face="Verdana, Helvetica, sans-serif">Den nomizo na isxiei auto! Sto vivlio pou exo den anaferei pouthena gia auti

tin vivliothiki(i oti allo einai) - Compile ginetai mono ama tin vgalo. M$ Rules <img border="0" title="" alt="[Razz]" src="images/icons/tongue.gif" /> Exallou den iparxei provlima me tin xrisi ton cin/cout (to eixe dokimasei me pio aples klaseis).

 

Evala xana tin C++ 6 kai to eftiaxa . Telika ta sintaktika lathi itan (alla pos ginetai na xtipaei internal error?)

 

thx hdkiller (tsekare ta pm sou)/girionis

Δημοσ.

O compiler tis M$ einai apo tous xeiroterous poy kikloforoun prosopika sou lew eixa arketa provlimata ...Edw den anagnorize tis friend sinartiseis(den xerw ean xrisimopoieis i oxi alla ston sxediasmo arketwn klasewn kai idietera stis sinartiseis iperfortosis twn telestwn << kai >> einai aparetites)ti na peis.Ean den peraseis to service pack tha exeis prob.Tespa oson afora ta namespaces grafw kwdika ce C++ edw kai 1 xrono gia logariasmo eterias pou den exei noima na anaferw ta stoixeia tis edw.Les na min gnorizw poy programatizw??To exw psaxei arketa me tin C++ nai pistepse me den einai oti kalitero i VC.Auta kai pisteuw na voithisa

 

<small>[ 08-10-2002, 20:48: Το μήνυμα επεξεργάστηκε από: HdkiLLeR ]</small>

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...