473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

parse error before `('

hi all,
the following problem has taken up a lot of my time n hence i'm
turning to the group.

i have a header file in which there r several class declarations (n a
separate file for the funcn defs). now, in a different src file i'm
dynamically creating objects of these classes. (i've included the
header file)

in one of such creations the compiler complains abt the parse error
at the name of the class.

the code is:
nw.transferPacket(time, WIRELESS, new Information(newMSS, MSS,
MHid, MH, hostList[MHid - 1].movementBuffer))

the compiler says:
"mhList.cpp:471: parse error before `(' "

other classes from the same header r used in the same way with no
problem. i've included guards in my header files n checked for
circular references.

i'll b grateful if someone could provide likely reasons for the
error.
Jul 22 '05 #1
3 2249


MoCha wrote:

i'll b grateful if someone could provide likely reasons for the
error.


Despite what you think you haven't included one of the types. Perhaps
its misspelt? Perhaps you cut&pasted stuff and now have the same guard
in more than one header file?

Jul 22 '05 #2
MoCha wrote:

in one of such creations the compiler complains abt the parse error
at the name of the class.

the code is:
nw.transferPacket(time, WIRELESS, new Information(newMSS, MSS,
MHid, MH, hostList[MHid - 1].movementBuffer))

the compiler says:
"mhList.cpp:471: parse error before `(' "


Check if the file compiles correctly when you comment out this line. If
not check the code preceding the line the for a missing semicolon,
unclosed parenthesis and other similar problems.

Regards,
Janusz

Jul 22 '05 #3
mo**************@rediffmail.com (MoCha) wrote in message news:<7d**************************@posting.google. com>...
hi all, the following problem has taken up a lot of my time n hence i'm turning to the group. i have a header file in which there r several class declarations (n a separate file for the funcn defs). now, in a different src file i'm dynamically creating objects of these classes. (i've included the header file) in one of such creations the compiler complains abt the parse error at the name of the class. the code is: nw.transferPacket(time, WIRELESS, new Information(newMSS, MSS, MHid, MH, hostList[MHid - 1].movementBuffer)) the compiler says: "mhList.cpp:471: parse error before `(' " other classes from the same header r used in the same way with no problem. i've included guards in my header files n checked for circular references. i'll b grateful if someone could provide likely reasons for the error.



the error was that the included header file was actually a different
version than the one i added my class to, of course with the same
name, n only this difference. since the inclusion was done indirectly
via several files, i couldn't (shame) catch it.

finally one bright mind saw my src file after preprocessing - the
perfect way to get to the root of this problem (using -E switch, as in
g++ -E <src>)

then it all clicked n worked :)
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steven | last post by:
I got a "Parse error: parse error in ..." in this line: if(empty($_POST){ ..... But if I fist assign $ssn=$_POST; and then if(empty($ssn){ ... it is working. Any advice? Thanks in advance.
1
by: H.L Bai | last post by:
hi, everybody i meet a parse error when i used the xml4c. any proposal is helpful. The error is following .../XMLRegionHandler.h:59 parse error before '*' .../XMLRegionHandler.h:60 parse...
2
by: Vittal | last post by:
Hello All, I am trying to compile my application on Red Hat Linux 8 against gcc 3.2.2. Very first file in application is failing to compile. I tried compiling my application on Linux 7.2...
21
by: BWIGLEY | last post by:
Basically I've just started making a game. So far it makes an array 25 by 20 and tries to make five rooms within it. In scr_make_room() there's parse errors: 20 C:\c\Rooms\Untitled1.c parse error...
6
by: trevor | last post by:
Incorrect values when using float.Parse(string) I have discovered a problem with float.Parse(string) not getting values exactly correct in some circumstances(CSV file source) but in very similar...
5
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called...
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
1
by: Phaelle | last post by:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' What does that error mean? I can´t find the mistake!! In another script, I have got another kind of mistake : parse...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
5
by: goldtech | last post by:
SAX XML Parse Python error message Hi, My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.