C++ 파일 스트림 사용할려는데 컴파일 오류 생기네요 ㅜㅜ..
글쓴이: kknd345 / 작성시간: 목, 2005/05/19 - 12:53오전
Quote:
Pro programming # g++ XXXX.cpp -o h
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/bits/ios_base.h: In
copy constructor `std::basic_ios<char, std::char_traits<char>
>::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/bits/ios_base.h:668: error: `
std::ios_base::ios_base(const std::ios_base&)' is private
XXXX.cpp:630: error: within this context
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/streambuf: In copy
constructor `std::basic_filebuf<char, std::char_traits<char>
>::basic_filebuf(const std::basic_filebuf<char, std::char_traits<char> >&)':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/streambuf:921: error: `
std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const
std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits =
std::char_traits<char>]' is private
XXXX.cpp:630: error: within this context
#include <iostream>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
ifstream IN=ifstream("XXXX.inp"); // 630 LINE
ofstream OUT=ofstream("XXXX.out");
char temp[100];
char *p_str;
HugeInt *p_HugeInt[100];
int i=0;
while( IN.getline( temp, 80 ) )
{
int t_cnt=strlen(temp);
for( i=0; i<t_cnt; i++)
*(temp+i)=toupper( *(temp+i) );
if( ( p_str= strtok(temp," \n") ) !=NULL )
{
command(p_str, p_HugeInt, OUT);
}
}
IN.close();
OUT.close();
return 0;
}
윈도우에서는 잘 됐는데
리눅스에서 컴파일 하니깐 에러나네요 ㅜㅜ... 왜 그런지 가르쳐 주세요.
Forums:


[code:1]ifstream IN("XXXX.inp
ifstream IN("XXXX.inp"); ofstream OUT("XXXX.out");로 하니 괜찮네요.
HugeInt나 command() 같은 것은 주석처리했구요.
윈도우에서 컴파일이 됐다면 컴파일러가 잘못된 것입니다.스트림 개체는
윈도우에서 컴파일이 됐다면 컴파일러가 잘못된 것입니다.
스트림 개체는 복사 및 대입이 불가능합니다.
댓글 달기