#32 realtime battle faile to compile with gcc-3.4

closed-fixed
Code (26)
5
2004-12-21
2004-12-20
No

It's me again.

A bug have been reported against my debian package, and
after making some verification, I forward it here.
There is an attached patch that don't seem to solve the
problem on my computer (at least with the last version
of realtimebattle).

From: Andreas Jochens <aj@andaco.de>
Subject: realtimebattle: FTBFS with gcc-3.4: invalid
initialization of reference of type 'const String&'
from expression of type 'const char*'

When building 'realtimebattle' with gcc-3.4 I get the
following error:

../include/List.h:108: error: invalid initialization of
reference of type 'const String&' from expression of
type 'const char*'
../include/List.h:93: error: in passing argument 2 of
`void Error(bool, const String&, const String&)'
../include/List.h: In member function `const
ListIterator<T>& ListIterator<T>::operator--(int)':
../include/List.h:117: error: invalid initialization of
reference of type 'const String&' from expression of
type 'const char*'
../include/List.h:93: error: in passing argument 2 of
`void Error(bool, const String&, const String&)'

With the attached patch 'realtimebattle' can be
compiled using gcc-3.4.

Regards
Andreas Jochens

Discussion

  • Rémi Vanicat

    Rémi Vanicat - 2004-12-20

    patch to compile with gcc-3.4

     
  • Johannes Nicolai

    • assigned_to: nobody --> jonico
     
  • Johannes Nicolai

    Logged In: YES
    user_id=863272

    Unfortunately; I only have gcc 3.3.3 on my machine, but after
    inspecting the patch, I think, that this is not the best solution.
    Qhat about adding anm include for String.hj in List.h?

     
  • Johannes Nicolai

    Logged In: YES
    user_id=863272

    For me it looks like the compiler does not know whether it can
    construct a const char* to a String because it is only known that
    the class String exists at all.
    So I really think, that an
    #include "String.h" will do

     
  • Rémi Vanicat

    Rémi Vanicat - 2004-12-21

    Logged In: YES
    user_id=40214

    Well, to add #include "String.h" in List.h solve the problem.
    But I the hit another problem : it seem that in somes files
    #included by iostream, they use a function wose name is min,
    and your definition of min as a macro make it fail. I send
    you a new patch that seem to solve this problem.

     
  • Johannes Nicolai

    Logged In: YES
    user_id=863272

    Thanks, if have to say that most of the code is not from our
    group, so we only fixed known bugs. I assume that your patch
    rely on the order of the included files, right?

    I will apply it soon. I would be an honor if I could add you to the
    realtimebattle developers on sourceforge, so that you can
    change things at your own.

     
  • Johannes Nicolai

    • status: open --> closed-fixed
     
  • Johannes Nicolai

    Logged In: YES
    user_id=863272

    So, the patch is applied now and the appropriate news have
    been written.
    I think, now compilation with gcc 3.4 should work.
    By the way, will RealTimeBattle 1.0.7 bring it into Sarge 8-)

     
  • Rémi Vanicat

    Rémi Vanicat - 2004-12-21

    Logged In: YES
    user_id=40214

    Yes, the idea of the patch is to be sure that Various.h is
    included after the inclusion of stl header so that no
    interference happen.

    For sarge, I don't know, I've to wait and see how the
    testing migration happen.

    For the posibility to add me to the realtimebattle team, I
    accept, but I don't know if I will be very active on it, as
    I'm on the way to pass severall competitive exam.

     

Log in to post a comment.