I've got a problem trying to compile a program written in Visual C++ in MinGW/GCC. While it works in VC++, MinGW dies on this piece of code:
with this error:
I don't have any idea what could be wrong (I'm kinda new to this, as you may have guessed), so any help is appreciated.
Regards,
shlainn
Code:
ByteBuffer &operator<<(const std::string &value)
{
append((uint8 *)value.c_str(), value.length());
append((uint8)0);
return *this;
}
Code:
./shared/ByteBuffer.h: In member function `ByteBuffer& ByteBuffer::operator<<(const std::string&)': ./shared/ByteBuffer.h:112: error: invalid use of undefined type `const struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >' C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stringfwd.h:56: error: declaration of `const struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >' ./shared/ByteBuffer.h:112: error: invalid use of undefined type `const struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >' C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stringfwd.h:56: error: declaration of `const struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >'
Regards,
shlainn
Comment