GCC 4.3 compatibility changes
  • Hi.

    I've tried building the Worldforge tools and libraries on a system with GCC 4.3 as default compiler. There are a few things that need some code changes, otherwise the software won't compile.

    In most cases it was just missing include files, which have been restructured in GCC 4.3 to speed up compile and preprocessing time. Some other problems were duplicate function parameters in prototypes. A porting guide can be found here.

    I did the following small changes, after which the libraries compiled fine with 4.3, and since those changes are backwards-compatible, they compiled fine with GCC 3.4.6, too.

    Skstream:
    skstream.cpp
    + #include <cstring>

    skserver.cpp
    + #include <cstring>


    Atlas-C++:
    Filter.cpp
    + #include <cstring>

    tools/atlas_convert.cpp
    + #include <cstdlib>


    Wfmath:
    no changes needed to be done


    Varconf:
    variable.cpp
    + #include <cstdlib>


    Mercator:
    RandCache.h
    + #include <cstdlib>

    AreaShader.cpp
    + #include <algorithm>

    AreaShader.h
    - void shadeArea(Surface& s, const Area* const s) const;
    + void shadeArea(Surface& s, const Area* const ar) const;


    Eris:
    Exceptions.h
    - InvalidAtlas(const std::string& msg, const Atlas::Message::Element& msg);
    + InvalidAtlas(const std::string& msg, const Atlas::Message::Element& el);

    Connection.h
    + #include <memory>

    Account.h
    + #include <memory>

    Metaserver.h
    + #include <memory>

    Metaserver.cpp
    + #include <cstring>

    EntityRef.h
    + #include <string>

    test/metaQuery.cpp
    + #include <algorithm>


    libwfut:
    platform.cpp
    + #include <algorithm>


    Those are all the needed changes to get them compile with 4.3. I didn't try the server and clients yet, which I might do during the next days.
    What is the preferred communication channel for something like this or for sending patches? Is it fine to use this forum or should I use the mailing list? In launchpad aren't all libraries registered yet, where someone could open a bug or so.
  • Hi, great work! The best way would be to send the patch to the General mailing list.
    It's true that not all libs are represented on the launchpad. If we start getting a lot of patches and bug reports we would probably need to add more projects, but until that the General mailing list would do fine.

    Regarding Ember: with gcc 4.2 you get a lot of warnings about deprecated conversions between "char*" and "const char*", which all stems from the tolua++ generated code (thus it would require a patch to tolua++). But I don't think there's anything else that would need patching, though it would be good to know.
  • How did i manage to miss this? I went the long way around to find the same answer.
  • "marc" said:
    Hi.

    I've tried building the Worldforge tools and libraries on a system with GCC 4.3 as default compiler. There are a few things that need some code changes, otherwise the software won't compile.

    In most cases it was just missing include files, which have been restructured in GCC 4.3 to speed up compile and preprocessing time. Some other problems were duplicate function parameters in prototypes. A porting guide can be found here.

    I did the following small changes, after which the libraries compiled fine with 4.3, and since those changes are backwards-compatible, they compiled fine with GCC 3.4.6, too.

    Skstream:
    skstream.cpp
    + #include <cstring>

    skserver.cpp
    + #include <cstring>


    Atlas-C++:
    Filter.cpp
    + #include <cstring>

    tools/atlas_convert.cpp
    + #include <cstdlib>


    Wfmath:
    no changes needed to be done


    Varconf:
    variable.cpp
    + #include <cstdlib>


    Mercator:
    RandCache.h
    + #include <cstdlib>

    AreaShader.cpp
    + #include <algorithm>

    AreaShader.h
    - void shadeArea(Surface& s, const Area* const s) const;
    + void shadeArea(Surface& s, const Area* const ar) const;


    Eris:
    Exceptions.h
    - InvalidAtlas(const std::string& msg, const Atlas::Message::Element& msg);
    + InvalidAtlas(const std::string& msg, const Atlas::Message::Element& el);

    Connection.h
    + #include <memory>

    Account.h
    + #include <memory>

    Metaserver.h
    + #include <memory>

    Metaserver.cpp
    + #include <cstring>

    EntityRef.h
    + #include <string>

    test/metaQuery.cpp
    + #include <algorithm>


    libwfut:
    platform.cpp
    + #include <algorithm>


    Those are all the needed changes to get them compile with 4.3. I didn't try the server and clients yet, which I might do during the next days.
    What is the preferred communication channel for something like this or for sending patches? Is it fine to use this forum or should I use the mailing list? In launchpad aren't all libraries registered yet, where someone could open a bug or so.


    I had to add:
    libwfut:
    platform.h
    + #include <algorithm>

    cegui-0.6.2:
    directfb-renderer.cpp
    + #include <algorithm>

    then everything went well.
  • Hi, thanks. I think libwfut is fixed in git head, and when you build CEGUI you don't need to build either the renderers or the samples though.
  • Yeah there were a few of the listed code changes already in place when i went to add them. I just lost track of which ones.
    As for cegui, Im not all that familiar with it, so i just built everything it threw at me.
    Anyway as far as wierd errors go, this thread answers them for me.
  • I am personally using gcc 4.3 to do all my WorldForge work. If there are any components which have not yet been updated then I am not aware of them. Please let me know what you find that needs work.
  • Well all i can say is that if i dont do every code change listed in this thread, I get errors for each one i didnt change.
    I had a list compiled of which changes hadnt been made yet, but i managed to screw up that machine, and had to reformat it.

    After i get done with the windows version of ember, ill try another mepis linux compile and post the needed changes.
    Keep in mind that these changes are needed by systems that are freshly installed, with the most up to date version of the operating system, And havent been used to compile anything previously.
    So if something is necessary it should show up.

    On a side note:
    I had to add http://downloads.sourceforge.net/gladewin32/gtk-dev-2.12.9-win32-1.exe the gtk dev environment, In order to get the win32 compilation to work in Msys, due to some dependencies not being met. I dont know if this is totally necessary or not, so i didnt try to edit the wiki at all. Ill leave that up to the experts.
  • I've been through most of the changes you list, and I've yet to find any which have no already been applied. Please check against the latest code, and if there are any still required, I will be happy to make the fixes.
  • Libraries not represented on launchpad are effectively stable at this point, with no immediate plans for features or significant known issues. Adding them to launchpad just creates clutter which I personally would rather avoid. If a need arises for significant development we can add them then.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID