hi!

i've got a problem i can't understand. i hope someone could help me.. :/

i've got this error:
syntax error : missing ';' before 'tag::id'

on this line in the code:

Graph :: Graph (char * str)
{
    // constructor...
}

the decleration of this function in the header file is:

Graph (char * str = NULL);

of course there is #include "Graph.h" on the start of the cpp file...

does someone have any idea why that heppen?
in this project there are lot of classes, and this is the only one that doing problems.. :/

I'm programming in vs6.0, if it is important..

Often the line that's given in the error is where the error finally breaks compilation. The actual problem is more likely to be up a few lines.

>I'm programming in vs6.0, if it is important..
It's important enough for me to tell you that Visual Studio 6 is one of the poorer C++ compilers. You'd be wise to upgrade.

Yes, I tend to agree with Narue. I would take a pot-shot and ask for you to check the closing statement of your Graph class, and make sure that it terminates with a };

It would be helpful to me if you posted the whole code (using code tags) you were trying to compile (if your question isn't already solved yet) ...
Probably you forgot to type a ';' somewhere in your code :)

first - thx.

about the line - i know, but it is the first line in the file! (after #include.. and some comments)

about vs6 - that i also know, but it is a compiler that is close enough to the compiler that my exercise would be checked..
it is my first compiler, after that i'm going to g++.


i'm just looking for a new direction of thought for an idea what is wrong here..

wow!

amrith92 - thx!!
although it wasn't ; in the end of the class that was missed, but in other place on the header, you made me look there carefully enough to put attention to that.

thx also to tux4life that said the same..
:)

how do i close the question?

wow!

amrith92 - thx!!
although it wasn't ; in the end of the class that was missed, but in other place on the header, you made me look there carefully enough to put attention to that.

thx also to tux4life that said the same..
:)

how do i close the question?

Glad it helped! :)

>but it is the first line in the file! (after #include.. and some comments)
Then it isn't the first line in the translation unit. The preprocessor is especially confusing to beginners until they realize that it's little more than an automated cut and paste. The contents of the header are inserted in place of the include directive.

>but it is a compiler that is close enough to the
>compiler that my exercise would be checked..
Close enough? If it's not exactly the same, you've got issues, because Visual Studio 6.0 doesn't conform to the C++ standard very well at all. Code that 6.0 will accept is often puked on by pretty much every other C++ compiler.

>it is my first compiler, after that i'm going to g++.
The newer versions of Visual Studio are much better than 6.0 and quite competitive with other conforming compilers (including g++). Just in case you feel you have to use g++ due to peer pressure, which I see fairly often.

it is my first compiler, after that i'm going to g++.

The newer versions of Visual Studio are much better than 6.0 and quite competitive with other conforming compilers (including g++). Just in case you feel you have to use g++ due to peer pressure, which I see fairly often.

you explained me a lot, thx. about that ^^:

I don't have right now how to get a newer version, and this version is given for free to students in my university.
about the g++ - this is the compailer that my exercise is checked in the end, so that is what i need..

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.