472,980 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,980 software developers and data experts.

Error C2143 missing ';' before '*' and others

Here is my code where I am receiving the error:
Expand|Select|Wrap|Line Numbers
  1. #include <fstream>
  2. #include "BinaryTree.h"
  3. using namespace std;
  5. Node* BinaryTree::MakeTree(ifstream& infile)
  6. {
  7.     char name;
  8.     infile>>name;
  9.     Node* base = new Node(name);    
  10.     return base;
  11. }
And here are the errors that I receive:

error C2143: syntax error : missing ';' before '*' //this error occurs on line 5

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

error C2556: 'int *BinaryTree::MakeTree(std::ifstream &)' : overloaded function differs only by return type from 'BinaryTree::Node *BinaryTree::MakeTree(std::ifstream &)

error C2371: 'BinaryTree::MakeTree' : redefinition; different basic types

error C2264: 'BinaryTree::MakeTree' : error in function definition or declaration; function not called

I assumed that the first error probably meant there was a missing semicolon somewhere in my BinaryTree.h file, but i have checked over it thoroughly and can't find see any place that it is missing. It doesn't make sense to me either that it wants a semicolon after "Node". It is just really weird!

I can provide my BinaryTree.h file if anyone wants to look at it.
Sep 4 '07 #1
2 5711
256 100+
Here is my code where I am receiving the error:
I can provide my BinaryTree.h file if anyone wants to look at it.
yes - please post your .h file - but (shot in the dark), did you forget the ';' at the end of your class definition?
Expand|Select|Wrap|Line Numbers
  1. class whatever
  2. {
  3. ... class members and such...
  4. };   // <---- this one 
Sep 4 '07 #2
463 Expert 256MB
The compiler doesn't know who Node is. Check for Node in the header file. Is Node defined? Does Node reside in a namespace?
Sep 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
by: Andrew Luke | last post by:
Hi all you C++ guru's! I'm 'very, very' new to C++ and I'm having a little trouble configuring my VS environment I think - when I try and compile some sample code I'm getting the following...
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
by: Qiao Yun | last post by:
I used vc++.net (visual studio .net ) to open a project which can work well in vc++6.0. I succeeded in compiling the project in vc++.net in release mode . But when I tried to compile the project...
by: Shashikiran Prabhakar via .NET 247 | last post by:
(Type your message here) Hi, I am not very conversent in VC++, but the requirement for me is to run a rendering code. However i am encountering the following errors. c:\Program...
by: George2 | last post by:
Hello everyone, What is wrong with the code, I just want to allocate an array of 100 void* pointers. :-) int main() { void** p;
by: sphenxes | last post by:
#include <cmath> #include <ctime> #include <cstdlib> #include <iostream> using namespace std; struct Pharmacology{ string genericName; string tradeName; string classification;
by: =?GB2312?B?yum09MXt?= | last post by:
today I forgot to include some header,then I found the error message by the compiler is quite strange. so I want to know exactly the inner details of the compiler impletation,if possible. and I...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.