Menu

g++ 4.8.3 amd64 with MinGW64 toolchain (build fails)

wpkg
2014-08-08
2014-11-25
  • Mathieu SCHROETER

    Hello,

    I try to build wpkg (0.9.4 with patch for MSYS/MinGW support) with MinGW64 and g++ 4.8.3, but :

    [ 59%]
    Building CXX object libdebpackages/CMakeFiles/debpackages.dir/wpkg_control_fields.cpp.obj
    s:/devel/bootstrap-windev/sysroot/toolchain/var/tmp/src/wpkg_0.9.4/libdebpackages/wpkg_control_fields.cpp: In member function 'virtual void wpkg_control::control_file::field_description_t::verify_value() const':
    s:/devel/bootstrap-windev/sysroot/toolchain/var/tmp/src/wpkg_0.9.4/libdebpackages/wpkg_control_fields.cpp:884:25: error: call of overloaded 'arg(size_t&)' is ambiguous
                      .arg(len)
                              ^
    

    Regards,

    Mathieu

     
  • Mathieu SCHROETER

    In order to fix I cast to (int) because it's just for logging; then it's safe.

     
  • Alexis Wilke

    Alexis Wilke - 2014-08-08

    Maybe we can fix that problem by changing the preprocessor test of the wpkg_output object:

    In the header file:

    #if defined(MO_WINDOWS) && defined(_WIN64)
        log& arg(const size_t v);
    #endif
    

    And then in the cpp file:

    #if defined(MO_WINDOWS) && defined(_WIN64)
    /** \brief Replace an argument with the size_t value.
     *
     * This function replaces an argument in the format string with the
     * numeric value of the specified parameter.
     *
     * \param[in] v  The value to replace the corresponding argument in the format string.
     *
     * \return The log reference.
     */
    log& log::arg(const size_t v)
    {
        std::ostringstream ss;
        ss << v;
        f_args.push_back(ss.str());
        return *this;
    }
    #endif
    

    That should work.

    Maybe it will change with a different version of g++ although I use 4.8.1 right now under Ubuntu and I don't have the problem, so I could imagine that it is related to compiling under MinGW and maybe somewhat emulating the behavior of cl.

     
  • Mathieu SCHROETER

    Hello,

    Something looks wrong with my patch?

    Regards

     
  • Alexis Wilke

    Alexis Wilke - 2014-09-17

    Hi Mathieu,

    I'm more that something wrong with my free time...

    Also, I think we need to have an MO_MINGW64 instead of using the internal value within the code. And not define MO_MINGW32 when MO_MING64 is defined.

    Thank you.
    Alexis

     
  • Yevgeny Krasovsky

    Alexis,

    I think there is no need to specify either MO_MINGW32 or MO_MINGW64.
    It would make things more complicated with no additional profit.
    I believe one define is enough and if you really need to test against 64-bit, then you may check if _WIN64 is defined.

    With regards,
    Yevgeny

     
  • Mathieu SCHROETER

    Hi,

    I use your patches (1, 3 and 5), then it works great with w64 and "MinGW Makefile" generator.

    Thank you very much.

     
  • Yevgeny Krasovsky

    Mathieu,
    You are welcome.
    It would be great if wpkg developers took part in wpkg development too :)

     
    • R. Douglas Barbieri

      And we would love to, as well, but the problem is, we are not getting paid to work on this anymore.

       

      Last edit: Alexis Wilke 2015-03-10

Log in to post a comment.