From: Colin Walsh Newsgroups: comp.os.msdos.djgpp Subject: Creating Class Libraries Date: Tue, 19 Aug 1997 16:35:26 -0230 Organization: Colossal Software Lines: 82 Message-ID: <33F9EE76.7A91@nf.sympatico.ca> Reply-To: cwalsh AT nf DOT sympatico DOT ca NNTP-Posting-Host: 204.101.95.15 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I have tried recently to create libraries supporting all of the filetypes that I keep creating for my various projects, but a problem has come up. I want the libs to use classes, but they wont compile properly. Here is the source that loads .CGR (Colossal GRaphics) #include #include #include class cgrfile{ protected: unsigned char *cgrdata; long w,h; public: cgrfile() { cgrdata=(unsigned char *)malloc(0); w=0; h=0; } void cgrload(char *filename,int palswitch) { unsigned char bit; unsigned char RGB[3]; fstream cgr(filename,ios::in|ios::binary); cgr.read((char *)&w,sizeof(long)); cgr.read((char *)&h,sizeof(long)); cgrdata=(unsigned char *)realloc((void *)cgrdata,w*h); if(palswitch==0)//dont load the palette { for(int x=0;x<256;x++) { cgr.read(RGB,3); } } if(palswitch==1)//load the palette { for(int x=0;x<256;x++) { cgr.read(RGB,3); GrSetColor(x,RGB[0],RGB[1],RGB[2]); } } for(long x=0;x