Thread: Help me with these errors... :-(

  1. #1
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787

    Help me with these errors... :-(

    okay, I have a complicated problem here, that's probably alot simpler than I think, but here goes... I'm getting these errors on Bloodshed Dev C++ V4.9.8.0. I put the errors then the line it highlites in the file...

    This is a pretty extensive list of errors, and i'd like to preface them by saying the only reason i'm posting them is because i've never seen any of them before, and can't figure out what to do from the string of files it sends me through... the only thing I can think of is chaniging the header files myself, seeing as it complains that they don't follow standards and are missing semi-colons, etc... if anybody can make any sense out of this mess, that would be greatly appreciated... and I'm attatching the source I used to get these errors... (which is still kinda messy because I started messing around with pointers when I got these errors, but the compiler stops before past including iostream)


    Code:
    ----------
    45 C:\Program Files\Dev-Cpp\include\c++\iosfwd
    In file included from C:/Program Files/Dev-Cpp/include/c++/iosfwd
    
    #include <bits/stringfwd.h> // For string forward declarations.
    ----------
    44 C:\Program Files\Dev-Cpp\include\c++\ios
                     from C:/Program Files/Dev-Cpp/include/c++/ios
    #include <iosfwd>
    ----------
    45 C:\Program Files\Dev-Cpp\include\c++\ostream
                     from C:/Program Files/Dev-Cpp/include/c++/ostream
    #include <ios>
    ----------
    45 C:\Program Files\Dev-Cpp\include\c++\iostream
                     from C:/Program Files/Dev-Cpp/include/c++/iostream
    #include <ostream>
    ----------
    18 C:\TCWIN45\BIN\dev c++\blackjack\main.cpp
                     from main.cpp
    #include <iostream>
    ----------
    46 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    semicolon missing 
    
    namespace std //from stringfwd.h
    ----------
    46 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    parse error before `
    
    namespace std //from stringfwd.h
    ----------
    47 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    ISO C++ forbids 
    
    {	//from stringfwd.h, right under that last error
    ---------
    47 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    syntax error before `
    {	//same as last one
    ---------
    51 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    `char_traits' is not 
    
      template<> struct char_traits<char>;
    ----------
    59 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    parse error before `<
    
    template<typename _CharT, typename _Traits = char_traits<_CharT>,
    ----------
    63 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    syntax error before `
    
    typedef basic_string<char>    string;
    ----------
    64 C:\Program Files\Dev-Cpp\include\c++\bits\stringfwd.h
    syntax error before `
    
    typedef basic_string<wchar_t> wstring;
    ----------
    6 C:\Program Files\Dev-Cpp\include\stddef.h
    In file included from C:/Program Files/Dev-Cpp/include/stddef.h
    
    #include_next<stddef.h>
    ----------
    6 C:\Program Files\Dev-Cpp\include\stddef.h
                     from C:/Program Files/Dev-Cpp/include/stddef.h
    
    #include_next<stddef.h>
    ----------
    48 C:\Program Files\Dev-Cpp\include\c++\cstddef
                     from C:/Program Files/Dev-Cpp/include/c++/cstddef
    
    #include <stddef.h>
    ----------
    50 C:\Program Files\Dev-Cpp\include\c++\cstdio
                     from C:/Program Files/Dev-Cpp/include/c++/cstdio
    
    #include <cstddef>
    ----------
    35 C:\Program Files\Dev-Cpp\include\c++\mingw32\bits\c++io.h
                     from C:/Program Files/Dev-Cpp/include/c++/mingw32/bits/c++io.h
    
    #include <cstdio>
    ----------
    44 C:\Program Files\Dev-Cpp\include\c++\bits\fpos.h
                     from C:/Program Files/Dev-Cpp/include/c++/bits/fpos.h
    
    #include <bits/c++io.h>
    ----------
    46 C:\Program Files\Dev-Cpp\include\c++\iosfwd
                     from C:/Program Files/Dev-Cpp/include/c++/iosfwd
    
    #include <bits/fpos.h>
    ----------
    44 C:\Program Files\Dev-Cpp\include\c++\ios
                     from C:/Program Files/Dev-Cpp/include/c++/ios
    
    #include <iosfwd>
    ----------
    45 C:\Program Files\Dev-Cpp\include\c++\ostream
                     from C:/Program Files/Dev-Cpp/include/c++/ostream
    
    #include <ios>
    ----------
    45 C:\Program Files\Dev-Cpp\include\c++\iostream
                     from C:/Program Files/Dev-Cpp/include/c++/iostream
    
    #include <ostream>
    ----------
    18 C:\TCWIN45\BIN\dev c++\blackjack\main.cpp
                     from main.cpp
    
    #include <iostream>
    ----------
    149 C:\Program Files\Dev-Cpp\lib\gcc-lib\mingw32\3.2\include\stddef.h
    template 
    
    typedef __PTRDIFF_TYPE__ ptrdiff_t;
    ----------
    149 C:\Program Files\Dev-Cpp\lib\gcc-lib\mingw32\3.2\include\stddef.h
    confused by earlier errors, bailing out
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  2. #2
    Master of the Universe! velius's Avatar
    Join Date
    Sep 2003
    Posts
    219

    Exclamation Need more from you.

    I can't compile your source file with out your header. I'd get errors about everything that belongs.
    While you're breakin' down my back n'
    I been rackin' out my brain
    It don't matter how we make it
    'Cause it always ends the same
    You can push it for more mileage
    But your flaps r' wearin' thin
    And I could sleep on it 'til mornin'
    But this nightmare never ends
    Don't forget to call my lawyers
    With ridiculous demands
    An you can take the pity so far
    But it's more than I can stand
    'Cause this couchtrip's gettin' older
    Tell me how long has it been
    'Cause 5 years is forever
    An you haven't grown up yet
    -- You Could Be Mine - Guns N' Roses

  3. #3
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    here it is:
    Code:
    /********MAIN.CPP*********/
    /*
    	main.cpp => defines entrypoint for user
    	
    	This program started as an assignment in a programming class, but after a
    	long time persuing other side-projects, I came back to it because I needed
    	a break from the other projects (battle system and AI)
    	
    	Major_Small
    */
    
    #ifndef _GAME_H
    #define _GAME_H
    #include "game.h"
    #endif
    
    #ifndef _iostream_h
    #define _iostream_h
    #include <iostream>
    #endif
    
    using std::cin;
    using std::cout;
    
    int main()
    {
    	char *name=new char[20];	//holds player's name
    	
    	cout<<"Enter your Name: ";
    	cin.getline(name,20,'\n');
    	
    	gameClass blackjack(name);
    	blackjack.play();
    	
    	delete[]name;
    	return 0;
    }
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  4. #4
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    This is how an class should look like :
    Code:
    class gameClass
    {
      // code 
    };
    In your print function you have this code:
    Code:
    for(int i=0;i<p1.hitcount;i++)
      cout<<card(p,i)<<' ';
    but I cant seem to find where p is declared

    There seems to be alot of other error aswell, like
    Code:
    if(p1.card[i]==1)
      return 'A';
    p1 is a cards struct variable put it doesnt contain a variable card[], maybe you want to use hand[] instead.

  5. #5
    Master of the Universe! velius's Avatar
    Join Date
    Sep 2003
    Posts
    219
    I agree, you have way too many errors in your program. Most seem to be due to your not good at writing with C++. You can't seem to remember when a variable is declaired or not. Hell you don't even know your own class too well.
    While you're breakin' down my back n'
    I been rackin' out my brain
    It don't matter how we make it
    'Cause it always ends the same
    You can push it for more mileage
    But your flaps r' wearin' thin
    And I could sleep on it 'til mornin'
    But this nightmare never ends
    Don't forget to call my lawyers
    With ridiculous demands
    An you can take the pity so far
    But it's more than I can stand
    'Cause this couchtrip's gettin' older
    Tell me how long has it been
    'Cause 5 years is forever
    An you haven't grown up yet
    -- You Could Be Mine - Guns N' Roses

  6. #6
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    ^ .......... you, stupid @$$hole

    >>This is how an class should look like...
    oops... forgot about that...

    >>p1 is a cards struct variable put it doesnt contain a variable card[], maybe you want to use hand[] instead.
    I've done that so many times... in an older program I had it the other way and now I'm confusing myself...

    >>but I cant seem to find where p is declared
    p and d are meant to be literal values... I forgot about the quotes

    Thanks for that... it cleared up the errors, but I still don't know where they came from... any help with that?
    Last edited by major_small; 09-07-2003 at 07:55 PM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  7. #7
    Master of the Universe! velius's Avatar
    Join Date
    Sep 2003
    Posts
    219
    Most errors that complain about a header file are generally caused by the programmer making a syntax mistake or two. When code is error free by syntax you would not get those type of errors. Of course you could have a corupted file (rare event) that could cause strange errors like those. An improper setting coud cause that too. A bad lib file as well.
    While you're breakin' down my back n'
    I been rackin' out my brain
    It don't matter how we make it
    'Cause it always ends the same
    You can push it for more mileage
    But your flaps r' wearin' thin
    And I could sleep on it 'til mornin'
    But this nightmare never ends
    Don't forget to call my lawyers
    With ridiculous demands
    An you can take the pity so far
    But it's more than I can stand
    'Cause this couchtrip's gettin' older
    Tell me how long has it been
    'Cause 5 years is forever
    An you haven't grown up yet
    -- You Could Be Mine - Guns N' Roses

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  2. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  3. Unknown Errors in simple program
    By neandrake in forum C++ Programming
    Replies: 16
    Last Post: 04-06-2004, 02:57 PM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 05:44 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 06:51 PM