Opened 6 years ago

Closed 6 years ago

Last modified 10 months ago

#6516 closed defect

ScummVM-Tools: Compile error with C++98

Reported by: Kirben Owned by: SF/mthreepwood
Priority: high Component: Tools
Keywords: Cc:
Game:

Description

I'm getting these errors when trying to compile the current ScummVM Tools GiT:
engines/sword1/compress_sword1.cpp: In member function 'virtual void CompressSwo
rd1::execute()':
engines/sword1/compress_sword1.cpp:751:8: error: 'std::string' has no member nam
ed 'pop_back'
engines/sword1/compress_sword1.cpp:757:4: error: 'transform' is not a member of
'std'

I'm using GCC 4.6.2 under MinGW.

Ticket imported from: bugs/6516.

Change History (10)

comment:1 Changed 6 years ago by SF/mthreepwood

I fixed it in revision 60b856b. Looks like criezy used an evil C++11 function.

comment:2 Changed 6 years ago by SF/mthreepwood

Owner: set to SF/mthreepwood
Status: newclosed
Summary: ScummVM-Tools: Compile error under MingwScummVM-Tools: Compile error with C++98

comment:3 Changed 6 years ago by Kirben

The first error is fixed, but the second error (transform) still occurs.

comment:4 Changed 6 years ago by SF/mthreepwood

Does it compile if you include ?

comment:5 Changed 6 years ago by SF/mthreepwood

Oh, I absolutely hate this bug tracker. It removed my <algorithm>.

comment:6 Changed 6 years ago by Kirben

No, that causes a different error:
engines/sword1/compress_sword1.cpp: In member function 'virtual void CompressSwo
rd1::execute()':
engines/sword1/compress_sword1.cpp:759:80: error: no matching function for call
to 'transform(std::basic_string::iterator, std::basic_string::iterat
or, std::basic_string::iterator, )'
engines/sword1/compress_sword1.cpp:759:80: note: candidates are:
f:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_algo.h:4871:5: note:
template _OIter std::transfor
m(_IIter, _IIter, _OIter, _UnaryOperation)
f:\mingw\bin../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_algo.h:4907:5: note:
template _OI
ter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)
make: *** [engines/sword1/compress_sword1.o] Error 1

comment:7 Changed 6 years ago by SF/mthreepwood

I guess <locale> is needed too for std::tolower.

comment:8 Changed 6 years ago by Kirben

No difference, when including locale.

Using 'tolower' instead of 'std::tolower' works though.

comment:9 Changed 6 years ago by SF/mthreepwood

Ah, good call. We're using the C version there. Pushed.

comment:10 Changed 10 months ago by digitall

Component: Tools
Note: See TracTickets for help on using tickets.