iostream conflicts fstream?

Discussion in 'C++' started by Michael, Oct 8, 2011.

  1. Michael

    Michael Guest

    #include <iostream>
    //#include <fstream>

    Hi
    when using both i get tons of errors but as above only
    a few alike:
    std::eek:fstream out’ has incomplete type and cannot be defined
    ....

    Any help? Thanks
    Michael
     
    Michael, Oct 8, 2011
    #1
    1. Advertising

  2. On 10/8/2011 7:35 AM, Michael wrote:
    > #include <iostream>
    > //#include <fstream>
    >
    > Hi
    > when using both i get tons of errors but as above only
    > a few alike:
    > std::eek:fstream out’ has incomplete type and cannot be defined
    > ...


    If you get errors by simply including two standard headers, your
    compiler is f***ed up. Or you're using headers from two different
    compilers. Or you didn't install them correctly (something is missing
    from the entire installation). Or maybe the errors are due to some
    other reason that you didn't list here. Try posting the *complete*
    source code that causes your problem. In the mean time, seek help from
    the technical support people for your compiler, who, BTW, will want the
    source code that causes problems, too.

    V
    --
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Oct 8, 2011
    #2
    1. Advertising

  3. Michael

    Michael Guest

    Victor I try to compile a osx project on linux that uses aes:
    ---------
    /* AES - Advanced Encryption Standard

    source version 1.0, June, 2005

    Copyright (C) 2000-2005 Chris Lomont

    This software is provided 'as-is', without any express or implied
    warranty. In no event will the author be held liable for any damages
    arising from the use of this software.

    Permission is granted to anyone to use this software for any purpose,
    including commercial applications, and to alter it and redistribute it
    freely, subject to the following restrictions:

    1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.
    2. Altered source versions must be plainly marked as such, and must
    not be
    misrepresented as being the original software.
    3. This notice may not be removed or altered from any source
    distribution.

    Chris Lomont


    The AES Standard is maintained by NIST
    http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf

    This legalese is patterned after the zlib compression library
    */

    // code to implement Advanced Encryption Standard - Rijndael
    // speed optimized version
    #include "AES.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <iostream>
    //#include <fstream>
    //#include <assert.h>
    //#include <pstring>
    //using namespace std;


    -----------------
    uncommenting fstream in aes.cpp gives ~400 errors...
    i use qtcreator with this pro file:
    -------

    unix:!macx {
    DEFINES += APL=0 IBM=0 LIN=1
    LIBS += -L../third_party_source/bullet-2.77/src/BulletDynamics
    LIBS += -L../third_party_source/bullet-2.77/src/BulletCollision
    LIBS += -llua -lBulletDynamics -lBulletCollision -lLinearMath
    -lcurl -lopenal -lalut
    TARGET = lin.xpl
    # WARNING! This requires the latest version of the X-SDK !!!!
    # QMAKE_CXXFLAGS += -fvisibility=hidden
    }

    -------
    About my biggest project to compile so far, so thanks
    Michael
     
    Michael, Oct 8, 2011
    #3
  4. Michael

    Michael Guest

     
    Michael, Oct 8, 2011
    #4
  5. Michael

    Michael Guest

    Victor, about my biggest compilation so far. Originates from osx which
    i compile on Ubuntu 10.04, so thanks. It uses aes as below:
    ----
    /* AES - Advanced Encryption Standard

    source version 1.0, June, 2005

    Copyright (C) 2000-2005 Chris Lomont

    This software is provided 'as-is', without any express or implied
    warranty. In no event will the author be held liable for any damages
    arising from the use of this software.

    Permission is granted to anyone to use this software for any purpose,
    including commercial applications, and to alter it and redistribute it
    freely, subject to the following restrictions:

    1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.
    2. Altered source versions must be plainly marked as such, and must
    not be
    misrepresented as being the original software.
    3. This notice may not be removed or altered from any source
    distribution.

    Chris Lomont

    The AES Standard is maintained by NIST
    http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf

    This legalese is patterned after the zlib compression library
    */

    // code to implement Advanced Encryption Standard - Rijndael
    // speed optimized version
    #include "AES.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <iostream>
    //#include <fstream>
    //#include <assert.h>
    //#include <pstring>
    //using namespace std;


    uncommenting fstream returns ~400 errors. I also use qtcreator with a
    project file as below:

    ---------
    unix:!macx {
    DEFINES += APL=0 IBM=0 LIN=1
    LIBS += -L../third_party_source/bullet-2.77/src/BulletDynamics
    LIBS += -L../third_party_source/bullet-2.77/src/BulletCollision
    LIBS += -llua -lBulletDynamics -lBulletCollision -lLinearMath
    -lcurl -lopenal -lalut
    TARGET = lin.xpl
    }
     
    Michael, Oct 8, 2011
    #5
  6. Michael

    Michael Guest


    > //#include <fstream>


    this is causing that many errors. Is there any replacement?
     
    Michael, Oct 8, 2011
    #6
  7. Michael

    Dombo Guest

    Op 08-Oct-11 19:05, Michael schreef:
    >
    >> //#include <fstream>

    >
    > this is causing that many errors. Is there any replacement?
    >


    The #include <fstream> is not the real source of the problem, reread
    Victors answer.
     
    Dombo, Oct 8, 2011
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Tiger
    Replies:
    10
    Views:
    5,601
  2. Charles L
    Replies:
    11
    Views:
    770
    Keith Meidling
    Jul 1, 2004
  3. ai@work
    Replies:
    9
    Views:
    546
    Ron Natalie
    Dec 16, 2004
  4. S. Nurbe

    iostream + iostream.h

    S. Nurbe, Jan 14, 2005, in forum: C++
    Replies:
    7
    Views:
    777
    red floyd
    Jan 15, 2005
  5. red floyd
    Replies:
    3
    Views:
    537
    Dietmar Kuehl
    Mar 8, 2005
Loading...

Share This Page