Menu

#2 Compilation errors with MingGW

open
nobody
None
5
2015-04-25
2006-04-21
Anonymous
No

C:\temp>gcc --version
gcc (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying
conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

C:\temp>gcc.exe -c disphelper.c -o disphelper.o
-I"C:/MinGW/include"
disphelper.c:791: warning: integer constant is too
large for "long" type
disphelper.c:793: warning: integer constant is too
large for "long" type
disphelper.c:795: warning: integer constant is too
large for "long" type

Discussion

  • Paulo Scardine

    Paulo Scardine - 2008-04-22

    Logged In: YES
    user_id=1560131
    Originator: NO

    To fix these warnings, postfix your large constant values with 'ULL', like the following example

    static const ULONGLONG LARGEVALUE_A = 864000000000; /* triggers warning */
    static const ULONGLONG LARGEVALUE_B = 864000000000ULL; /* correct */

     
  • Big William

    Big William - 2008-10-10

    making the modifications with:
    1) addition of postfix the ULL
    2) #define _GLIBCPP_USE_WCHAR_T 1

    is not successful to compile with Code:: Blocks ver.8.02 and with DevCpp 5

    Help me

     
  • Ivan Topolsky

    Ivan Topolsky - 2015-04-25

    For whom it might interest:
    Back in 2009 when we used xtmouse's DispHelper, we needed the following extra modifications:

    • map the C99 compliant swprintf for the Microsoft-only _snwprint
    • use proper wide-char format specifier (%ls) in swprintf
    • use VARIANT macro accessors like V_VT(pvResult) instead of pvResult->vt

    With these fixes, not only were we able to use it with GCC compiler under windows (like MinGW32) but even get it working on Linux with wine-gcc

    My patched version is available under this github fork:
    https://github.com/DrYak/disphelper

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.