compatibility

Vortmann, Claas claas.vortmann@iket.fzk.de
Wed Dec 15 11:42:00 GMT 2004


Hello,

I have a huge code that is running without problems under SuSE-Linux 8.0 
(gcc version 2.95.3).

When I change to SuSE-Linux8.2 (gcc version 3.3), the code can not be 
compiled anymore.

I've tracked down the problem to a very simple c++ testcase (see  below) 
that shows the same behaviour, and produces the same error message.

----------------------------------------------------------------------------- 

#include <fstream.h>
#include <iostream.h>

int main()
{

 ofstream fout;
 fout.open("solid_position.dat",ios::out || ios::ate);

return 0;
}
------------------------------------------------------------------------------------ 


The error message says (find the complete error message attached) :

hallo.cpp:13: error: no matching function for call to `
  std::basic_ofstream<char, std::char_traits<char> >::open(const char[19],
  bool)'

Since I dont want to change the syntax (iostream.h -> iostream etc.) of 
the huge code, I thought of including some old libraries during the 
linking process.
Unfortunately without success.

I would be glad, if somebody can give me a hint.
Thanks in advance
Claas




The complete error message:
----------------------------------

In file included from /usr/include/g++/backward/fstream.h:31,
                from hallo.cpp:1:
/usr/include/g++/backward/backward_warning.h:32:2: warning: #warning 
This file includes at least one deprecated or antiquated header. Please 
consider using one of the 32 headers found in section 17.4.1.2 of the 
C++ standard. Examples include substituting the <X> header for the <X.h> 
header for C++ includes, or <sstream> instead of the deprecated header 
<strstream.h>. To disable this warning use -Wno-deprecated.
hallo.cpp: In function `int main()':
hallo.cpp:13: error: no matching function for call to `
  std::basic_ofstream<char, std::char_traits<char> >::open(const char[19],
  bool)'
/usr/include/g++/fstream:686: error: candidates are: void
  std::basic_ofstream<_CharT, _Traits>::open(const char*, 
std::_Ios_Openmode =
  (std::ios_base::out | std::ios_base::trunc)) [with _CharT = char, 
_Traits =
  std::char_traits<char>]



More information about the Gcc-help mailing list