CEGUI headers generate inline/dllimport warnings on GCC with Windows

Issue #55 closed
Former user created an issue

Automatic migration. Original reporter: "mdmkolbe"

The public headers are generating lots (700+) of warnings on GCC with Windows (at least with -W -Wall). Generally public headers should be warning free as any warnings in them will cause warnings in any downstream project.

The warnings are of the form: include/CEGUIString.h:4772: warning: inline function 'void CEGUI::String::init()' is declared as dllimport: attribute ignored.

The straightforward solution would be to move the bodies of these implicitly inline functions to a *.cpp file. However in discussion on IRC, Dalfy indicated that doing that would cost significant performance on unix. Other solutions suggested include: making CEGUIEXPORT empty in the non-export, non-MSVC case; pulling the function bodies into a file that is conditionally included in either the *.h or *.cpp files depending on which is safe.

Reproducibility: always

Additional information: Attached are the warnings.

Compiler is: gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) Compiled with "-W -Wall". System is: CYGWIN_NT-5.1 seville 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin

Comments (7)

  1. Former user Account Deleted

    Original reporter: morgul

    The patch I uploaded seems to take care of this for me.

  2. Former user Account Deleted

    Original reporter: Dalfy

    SILLY headers have been designed so that this issue is not a problem. Maybe a similar approach can be used for CEGUI.

  3. Former user Account Deleted

    Original reporter: mdmkolbe

    Dalfy, could you be more specific as to how they have been designed to avoid this problem? Glancing at the SILLY headers, they look like they are doing exactly the same things as the CEGUI headers.

  4. Former user Account Deleted

    Original reporter: Xirnohn

    The DevIl codec still have this issue(while the other codecs dont have CEGUIEXPORT).

    class CEGUIEXPORT DevILImageCodec : public ImageCodec

  5. Former user Account Deleted

    Original reporter: Dalfy

    CEGUI does not build correctly on Mingw32 / Cygwin

    MINGW and CYGWIN compatability This patch converts all render, xmlparser, and major header files to allow both MINGW and CYGWIN to compile cegui. neither platform accept declspec(dllimport).

    Imported from sourceforge on July 16, 2006 Submitted by macguyvok

  6. Former user Account Deleted

    Original reporter: Dalfy

    This patch makes it possible to compile on MinGW, though more work is needed to get it to work on MSYS. Essentially MinGW throws warnings when is sees declspec(dllimport), so these are defined out if MINGW32 is seen, which is defined by the compiler. Also MinGW's std::exception doesn't accept a parameter in it's constructor, so these and their corresponding catches were replaced with CEGUI::String for MinGW only.

  7. Log in to comment