Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

iostream conflicts fstream?

12 views
Skip to first unread message

Michael

unread,
Oct 8, 2011, 7:35:19 AM10/8/11
to
#include <iostream>
//#include <fstream>

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

Any help? Thanks
Michael

Victor Bazarov

unread,
Oct 8, 2011, 9:46:31 AM10/8/11
to
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::ofstream 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

Michael

unread,
Oct 8, 2011, 10:33:34 AM10/8/11
to
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
ch...@lomont.org

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

unread,
Oct 8, 2011, 10:35:27 AM10/8/11
to

Michael

unread,
Oct 8, 2011, 10:40:25 AM10/8/11
to
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:

---------

Michael

unread,
Oct 8, 2011, 1:05:03 PM10/8/11
to

> //#include <fstream>

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

Dombo

unread,
Oct 8, 2011, 1:28:27 PM10/8/11
to
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.

0 new messages