Thread: Problems porting from MSVC++ to Apple Developer Tools

  1. #1

    Problems porting from MSVC++ to Apple Developer Tools

    I have code that compiles with no warnings on MSVC++ 6.0, and am trying to port it for a friend running the compiler in the Project Builder app for Mac OS. When he tries to compile, he gets an error
    main.cpp:241: no match for `Bint& - Bint' operator
    where I've indicated line 241 in the code below.

    Here is the implementation of the function giving me problems:
    bool Bint::operator~(void)
    	int digit;
    	for(int i=0;i<size;i++)
    		Bint& temp=Bint(&digit,1,base);
    		*this=this->operator-(temp); //Subtract each digit, one at a time,
    		//from the number
    	if(size==2 && digits[0]==0) //Check for 0
    		return false;
    	return true;
    Line 241 is the one beginning with *this=this...

    Here is the class definition:
    class Bint
    	Bint(const char *init, int base);
    	Bint&(Bint &init);
    	int GetSize(void) const {return size-1;};
    	Bint operator+(Bint &second) const;
    	Bint operator-(Bint &second) const;
    	Bint operator=(Bint &second);
    	bool operator~(void);
    	friend ostream& operator<< ( ostream& os, Bint num);
    	Bint(const int *init, int size, int base);
    	int *digits;
    	int base;
    	int size;
    Does anybody have any ideas what my mistake is?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Replace that line with
    *this = *this - temp; //Subtract each digit, one at a time,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Must have tools for the .NET developer
    By sean in forum A Brief History of
    Replies: 1
    Last Post: 08-22-2004, 09:24 AM
  2. Linux To FreeBSD Porting Compile Problems
    By DeepBlackMagic in forum Linux Programming
    Replies: 4
    Last Post: 03-17-2004, 08:17 AM
  3. Are there any porting problems with VS.Net?
    By jdinger in forum A Brief History of
    Replies: 4
    Last Post: 07-24-2003, 11:14 PM
  4. MSVC Problems
    By Unregistered in forum A Brief History of
    Replies: 2
    Last Post: 11-18-2001, 09:56 PM
  5. Borland to MSVC, code problems
    By Eber Kain in forum C++ Programming
    Replies: 1
    Last Post: 10-19-2001, 05:35 AM