#2 build error

closed
General (5)
5
2008-08-06
2007-04-03
Mattias Seeman
No

I still get this error (with gcc version 4.1.2 20061115 (prerelease)
(Debian 4.1.1-21)), same bug as http://sourceforge.net/tracker/index.php?func=detail&aid=1650232&group_id=158170&atid=806760 . The patch fixing this problem (for me, as well as getting rid
of the 'deprecated header' warning) is attached below the error message:

Error message: =======================================================

/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/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 <iostream> instead of the
deprecated header <iostream.h>. To disable this warning use
-Wno-deprecated.
../../kalman/ekfilter_impl.hpp:395: error: expected initializer before
‘&’ token
../../kalman/ekfilter_impl.hpp:412: error: expected initializer before
‘&’ token
../../kalman/ekfilter_impl.hpp:425: error: expected initializer before
‘&’ token
../../kalman/ekfilter_impl.hpp:430: error: expected initializer before
‘&’ token
make: *** [example.o] Error 1

======================================================================

Patch is against the files in the kalman-1.1.zip release.
Patch: ===============================================================
Index: kalman/kvector_impl.hpp
===================================================================
--- kalman/kvector_impl.hpp (revision 247)
+++ kalman/kvector_impl.hpp (working copy)
@@ -30,7 +30,7 @@
//! \file
//! \brief Contains the implementation of the \c KVector template class.

-#include <strstream>
+#include <sstream>

namespace Kalman {

@@ -129,9 +129,9 @@
inline T& KVector<T, BEG, DBG>::operator()(K_UINT_32 i) {
if (DBG) {
if (i < BEG || i >= n_ + BEG) {
- std::ostrstream oss;
+ std::ostringstream oss;
oss << "Trying to access element " << i << " not included in ["
- << BEG << ", " << n_ + BEG - 1 << "]." << '\0';
+ << BEG << ", " << n_ + BEG - 1 << "].";
throw OutOfBoundError(oss.str());
}
}
@@ -146,9 +146,9 @@
inline const T& KVector<T, BEG, DBG>::operator()(K_UINT_32 i) const {
if (DBG) {
if (i < BEG || i >= n_ + BEG) {
- std::ostrstream oss;
+ std::ostringstream oss;
oss << "Trying to access element " << i << " not included in ["
- << BEG << ", " << n_ + BEG - 1 << "]." << '\0';
+ << BEG << ", " << n_ + BEG - 1 << "].";
throw OutOfBoundError(oss.str());
}
}
Index: kalman/ktypes.hpp
===================================================================
--- kalman/ktypes.hpp (revision 247)
+++ kalman/ktypes.hpp (working copy)
@@ -37,7 +37,7 @@
#include <string>

// Patch for MSVC++ 6.0 lack of support for templates
-#if (_MSC_VER <= 1200)
+#if (defined(_MSC_VER) && _MSC_VER <= 1200)
#define KTYPENAME
#else
#define KTYPENAME typename
Index: kalman/kmatrix_impl.hpp
===================================================================
--- kalman/kmatrix_impl.hpp (revision 247)
+++ kalman/kmatrix_impl.hpp (working copy)
@@ -30,7 +30,7 @@
//! \file
//! \brief Contains the implementation of the \c KMatrix template class.

-#include <strstream>
+#include <sstream>

namespace Kalman {

@@ -195,10 +195,10 @@
K_UINT_32 j) {
if (DBG) {
if (i < BEG || i >= m_ + BEG || j < BEG || j >= n_ + BEG) {
- std::ostrstream oss;
+ std::ostringstream oss;
oss << "Trying to access element (" << i << ", " << j
<< ") not included in [" << BEG << ", " << m_ + BEG - 1 <<
"]["
- << BEG << ", " << n_ + BEG - 1 << "]." << '\0';
+ << BEG << ", " << n_ + BEG - 1 << "].";
throw OutOfBoundError(oss.str());
}
}
@@ -215,10 +215,10 @@
K_UINT_32 j) const {
if (DBG) {
if (i < BEG || i >= m_ + BEG || j < BEG || j >= n_ + BEG) {
- std::ostrstream oss;
+ std::ostringstream oss;
oss << "Trying to access element (" << i << ", " << j
<< ") not included in [" << BEG << ", " << m_ + BEG - 1 <<
"]["
- << BEG << ", " << n_ + BEG - 1 << "]." << '\0';
+ << BEG << ", " << n_ + BEG - 1 << "].";
throw OutOfBoundError(oss.str());
}
}
======================================================================

Discussion

  • Vincent Zalzal
    Vincent Zalzal
    2008-08-06

    • status: open --> closed