Results 1 to 6 of 6

Thread: Problem including headers

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416

    Problem including headers

    Ok, I'm using mySQL++ ....

    #include <mysql++>

    .. Which works fine on its own, but when I try to #include <fstream.h> ... I get 100+ errors. The main errors are "ambiguous symbol" errors. I also get syntax error : identifier and some other qweer errors.

    How can I use both these headers at the same time? I need them both

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416
    well, i had to do:

    #include <fstream>

    ... but then fstream class constructors were different, and filebuf::sh_* 's werent available to me.

    I dont like messing with stream headers, they always cause problems.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    <fstream.h> are the old iostreams, <fstream> the new ones. They are slightly different, but better. Just look it up in a current reference.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The constructors shouldn't be that much different. You're having trouble because you're mixing non-standard code (fstream.h) with standards-based code(mysql++ and fstream).

    The new Standard C++ Library headers don't have the .h extension, things like <iostream>, <fstream>, <string>, <list>, etc.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The new library no longer supports sharing definitions. I don't know why, but I won't miss them.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I never even found out what they were. Suppose I never needed them.

    Looks like it's time for me to do some research...
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width