CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2002
    Posts
    61

    Just a bad day? (compiler errors)

    I tried to compile some code that I've been working with and compiled several time only today I'm getting A LOT of compiler errors. This one in particular is bothering me:
    I get
    "c:\dev-cpp\fabsim\globalmeta.cpp(71) : error C2064: term does not evaluate to a function"
    from VSC 6.0.

    the piece its talking about is:
    Code:
    int VolTableG::bindNext(VolTableG * next)
    //Assign volume as next in list
    {
    	if(next()) next->myNext = next();
    	myNext = next;
    	return 1;
    }
    which refers to:
    Code:
    VolTableG *	VolTableG::next()
    //get next Volume in list
    {
    	return myNext;
    }
    ANy ideas? thanks guys.
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725
    just a quick guess ...

    Code:
    if(next()) next->myNext = next();
    but

    Code:
    int VolTableG::bindNext(VolTableG * next)
    "hides" the next() function ... bindNext() thinks next is a
    pointer to a VolTableG variable.

    Either change the name of the "next" variable in bindNext,
    or maybe ...

    Code:
    if(VolTableG::next()) next->myNext = next();

  3. #3
    Join Date
    Jan 2004
    Location
    Düsseldorf, Germany
    Posts
    2,401
    Try changing the parameter name (now next could be a function pointer and a VolTableG*).
    Try also replacing "next()" with "this->next()".

  4. #4
    Join Date
    Apr 2002
    Posts
    61
    renaming the variable did work, defining the namespace didn't, odd that I didn't have this problem compiling the other day...

    wanna take a shot at this one:
    "c:\dev-cpp\fabsim\datastamp.h(32) : error C2143: syntax error : missing ')' before ';'
    c:\dev-cpp\fabsim\datastamp.h(32) : error C2143: syntax error : missing ')' before ';'
    c:\dev-cpp\fabsim\datastamp.h(32) : error C2460: 'string' : uses 'DataStamp', which is being defined"

    reffering to: DataStamp(tsDBtype db);
    in:
    Code:
    class DataStamp
    {
    	public:
    		DataStamp();
    		DataStamp(tsDBtype db);
    		~DataStamp();
    
    		bool		add(tsData &ts);
    		bool		update(tsData &ts);
    		void		remove(tsData &ts);
    		TimeStmp	retrieve(tsData &ts);
    
    		setDB(tsDBtype db);
    
    		cleanup();
    
    	private:
    		tsData objKey1;			//Timstamp sample
    		tsDBtype myDB;			//Location of DB
    		ulong DBSize;			//Entries added to DB
    		ulong activeTScount;	//Active Entries
    
    		int seekLocation(tsData &ts);
    
    };
    BTW definitions.h has "#define tsDBtype string"

    I'm interested to know why these files compiled the other day and not today... could adding the string.h to the mix have caused this?

  5. #5
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867
    Is "string.h" the standard one that comes with most compilers or a custom one that you wrote yourself? Also, what type of variable is "string" anyway? Presumably it's a class of some sort that you wrote? Finally, what compiler are you using? It looks like Visual C++. Is that right?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured