iostream conflicts fstream?

M

Michael

#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
 
V

Victor Bazarov

#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
 
M

Michael

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
(e-mail address removed)

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
}
 
M

Michael

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
}
 
D

Dombo

Op 08-Oct-11 19:05, Michael schreef:
this is causing that many errors. Is there any replacement?

The #include <fstream> is not the real source of the problem, reread
Victors answer.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Chatbot 0
fstream File i/o 1
TF-IDF 2
fstream vs ofstream 6
Character operations in C++ 2
std::fstream::seekp( ... std::ios::end ) 2
Filter sober in c++ don't pass test 0
fstream - write a file 3

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top