Dev-C++

Started by
25 comments, last by dustydoodoo 19 years ago
Ummm, there is something wrong with my Dev-C++ compiler, for some reason, when i try and compile my win32 program, it has an error about the constructor/destructor, it doesnt know what they are, it thinks im trying to make a function with no function type. Well how would i fix this?
Sure i will write my signature, just gimme a piece of paper
Advertisement
If you can show us some code, I'm sure we will be able to help you. Don't forget to use the [source] [/source] tags.
No No, its not my code, its the compiler, because it compiles with my other compiler (Borland 5.5).
Sure i will write my signature, just gimme a piece of paper
Quote:Original post by dustydoodoo
No No, its not my code, its the compiler, because it compiles with my other compiler (Borland 5.5).

All compilers are different. You may have to make some changes to your code to get it to work on multiple compilers.
Quote:Original post by dustydoodoo
No No, its not my code, its the compiler, because it compiles with my other compiler (Borland 5.5).


The reason we ask to see code is that it is not cross compiler compliant. If you have code that works in Visual Studio 6, it might not work in Visual Studio 7. It could perhaps work in Dev-CPP. If I took code from Dev-CPP, I'm sure Borland might have some troubles with a few things.

As long as you are using the most recent version of Dev-CPP 4.9.9.2 Beta, the compiler works well, it just does not like something in your code. That's the best way to explain this.
fine, here is my code (the part with the problem)

           SetDefault()           {               BitmapLoaded = false;           }                          ~Bitmap()           {                DeleteObject(bitmap);           }
Sure i will write my signature, just gimme a piece of paper
SetDefault(){    BitmapLoaded = false;} 

Needs to be:
void  SetDefault(){    BitmapLoaded = false;} 


You must specify the return type for non-constructors/deconstrctors.
Quote:Original post by Drew_Benton
SetDefault(){    BitmapLoaded = false;} 

Needs to be:
void  SetDefault(){    BitmapLoaded = false;} 


You must specify the return type for non-constructors/deconstrctors.


WHAT!!?? But i need that constructor/destructer
Sure i will write my signature, just gimme a piece of paper
Quote:Original post by dustydoodoo
Quote:Original post by Drew_Benton
SetDefault(){    BitmapLoaded = false;} 

Needs to be:
void  SetDefault(){    BitmapLoaded = false;} 


You must specify the return type for non-constructors/deconstrctors.


WHAT!!?? But i need that constructor/destructer

SetDefault() is not a contructor unless the class name is SetDefault. You can call SetDefault() from the constructor
Bitmap(){	SetDefault();}
Well then whats wrong with the destructor!?
Sure i will write my signature, just gimme a piece of paper

This topic is closed to new replies.

Advertisement