hi ...

An error: There is missing ; before * ..


What does that mean ..

Plz help me

the project on the attachment

Dani AI

Generated

Several common parsing problems produce MSVC errors like "missing ; before *". The usual culprits are: a prior class/struct/enum missing its trailing semicolon, method declarations inside a class missing an explicit return type, use of a type before it is declared (no forward declaration), or a circular include dependency between headers. correctly flagged omitted return types — that alone can confuse the compiler and make the next lines look like unrelated syntax errors. and were also right to ask for the exact error text and the few lines around the reported line number.

A pragmatic checklist to isolate the real cause:

  • Copy the exact compiler error (file, line, column) and open that file. Inspect the lines immediately above the reported spot for an unclosed brace or a missing semicolon at the end of the previous class/struct/enum.
  • Scan class declarations for any member-function declarations without an explicit return type; compilers then misparse the following tokens.
  • If a pointer/reference to another class is used, confirm that either the full type is already declared or a forward declaration is present. Replace problematic header includes with forward declarations in headers and move full includes to the .cpp files.
  • To debug macro collisions or surprising expansions, examine the preprocessor output (for gcc/clang: g++ -E file.cpp > file.i; for MSVC: generate the preprocessed file) and search for unexpected token substitutions.
  • Reduce to a minimal reproducible example: comment out files until the error disappears, then reintroduce pieces to find the exact header or declaration that triggers the message.

Small design note: if two classes refer to each other by value, forward declarations cannot help and the design must be changed (use pointers/references, split responsibilities, or combine related types). When posting for help, include the exact error lines, the surrounding five to ten lines of the header(s) involved, the compiler and version, and whether the code compiles with another compiler (as mentioned by ). That information makes diagnosis fast and prevents chasing misleading symptoms.

Recommended Answers

All 10 Replies

It also tells you in what file and on what line the error is. Post those lines of code instead of just uploading your entire project for someone else to figure out

It also tells you in what file and on what line the error is. Post those lines of code instead of just uploading your entire project for someone else to figure out

Just Compile the Project , The list of Errors will appear ...

Thanx

Just Compile the Project , The list of Errors will appear ...

Why? Because you're too damn lazy to post the linenumbers and file here?
I'm not downloading anything random from the internet, I like my PC lean and clean.

Why? Because you're too damn lazy to post the linenumbers and file here?
I'm not downloading anything random from the internet, I like my PC lean and clean.

First it's not a project , just a tiny program consists of a set of classes ..

Second the program is quite complex and by writing the line number , that kind will not solve the problem , so i am giving you a chance to look at my code in order to analayze the error reasons and Source ..

it's a syntax error, the compiler will tell you what line it's having a problem with. Take that line of code, or the procedure that line of code is in, wrap it in [ code=cpp] [ /code] tags (without the spaces of course) and place it here.

Also,

"it's not a project , just a tiny program consists of a set of classes .."
"the program is quite complex"

you're being inconsistent. If you want help you will need to format your question in a way that people can easily look at your code and detect the error with as little hassle as possible.

so i am giving you a chance to look at my code in order to analayze the error reasons and Source ..

Lucky me! That you choose me of all people to "have a change to look at your code"
And here I was thinking that you needed help :) How foolish of me! I should have known that your 'skilz' are far superior to my own and I apologize for being so impolite.

Now if you'll excuse me, I'll download and print your code and go and meditate for a few days on top of it, to see if I can reach the same level of enlightenment as you have.

:icon_wink:

lol oh noz progamming flame warz

lol oh noz progamming flame warz

Don't use the words 'flame war', some Mod may come along and give me an infraction for it ;)

Totally off-topic:
If you want to tell a poster to use code-tags, you can use [noparse][/noparse] tags for it:
[noparse][code=cplusplus] [/code][/noparse]
will result in :
[code=cplusplus] [/code]

That way you wont have to tell the poster to type it without spaces :)

hey thanks, I wondered how others did it.
Also, flame wars might be appropriate considering your avatar.

Also, back to the original problem in the thread,
Not everybody is going to have the same compiler as you, I for one do not use Microsoft Visual C++ -- I tried compiling main.cpp using gcc, and it compiled fine. Upon further inspection of the code, I found that it had a main() function which only returned 0, and included iostream... So I don't know how to help you, or where your error is.

.....

you can't declare methods of a class without a return type. You seem to think that "setDate" doesn't have to return a value. Ok, I can respect that. How 'bout you make it return a void type. Only ctors and dtors can skip return values (and I think must)

class date
{

private:

	int d;		// Day

	int m;		// Month

	int y;		// Year

public:

	date();

	setDate(int d, int m, int y); // Really?
        void setDate(int d, int m, int y);  // Better.
};

Do this for all of your messed up lines, and the original error you found ( missing ; before * .. ) will go away when you fix all the other errors. Don't count on it happening right away either.... you have a circle jerk of classes that all refer to each other.... barrower refers to copy inside of it's members, while copy refers to barrower in it's class definition... which came first the chicken or the egg?

Redesign your entire project, using some kind of UML or Flowchart, and try again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.