Results 1 to 4 of 4

Thread: MinGW build fail: many "cannot convert 'const wchar_t*' to 'const CHAR*" errors

  1. #1

    Default MinGW build fail: many "cannot convert 'const wchar_t*' to 'const CHAR*" errors

    I've tried to build ClanLib 2.2.1 on msys + mingw (gcc 4.4.0, make 3.81), windows Xp SP3.

    Several days I compiled needed libraries (for ex. SDL, libpng, zlib, fontconfig etc.)

    And now during "./configure --prefix=/mingw --enable-static --disable-shared" execution I don't get warning messages except for
    1) ClanRegExp, because "pcre-config" can't be found in spite of pcre-mingw-7.9-bin and pcre-mingw-7.9-lib installed.
    2) ClanMikMod, because I don't want support of MikMod.

    So, when I type in "make" command and go build crashes with such output:

    ....
    g++ -DPACKAGE_NAME=\"ClanLib\" -DPACKAGE_TARNAME=\"clanlib\" -DPACKAGE_VERSION=
    \"2.2.1\" "-DPACKAGE_STRING=\"ClanLib 2.2.1\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAG
    E=\"clanlib\" -DVERSION=\"2.2.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_S
    YS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS
    _H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -D
    HAVE_STDBOOL_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DEXTERN___PROGNAME=1 -DHAVE
    _LIBZ=1 -I. -I. -msse2 -g -O2 -msse2 -I/usr/local/include/freetype2 -I/usr/local
    /include -I../../Sources -MT IOData/libclan22Core_la-directory.lo -MD -MP -MF IO
    Data/.deps/libclan22Core_la-directory.Tpo -c IOData/directory.cpp -o IOData/libc
    lan22Core_la-directory.o
    IOData/directory.cpp: In static member function 'static bool CL_Directory::creat
    e(const CL_String&)':
    IOData/directory.cpp:85: error: cannot convert 'const wchar_t*' to 'const CHAR*'
    for argument '1' to 'DWORD GetFullPathNameA(const CHAR*, DWORD, CHAR*, CHAR**)'

    IOData/directory.cpp:97: error: cannot convert 'const wchar_t*' to 'const CHAR*'
    for argument '1' to 'DWORD GetFullPathNameA(const CHAR*, DWORD, CHAR*, CHAR**)'IOData/directory.cpp:111: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'BOOL CreateDirectoryA(const CHAR*, _SECURITY_ATTRIBUTES*)
    '
    IOData/directory.cpp: In static member function 'static bool CL_Directory::remov
    e(const CL_String&, bool, bool)':
    IOData/directory.cpp:127: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'DWORD GetFullPathNameA(const CHAR*, DWORD, CHAR*, CHAR**)
    '
    IOData/directory.cpp:139: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'DWORD GetFullPathNameA(const CHAR*, DWORD, CHAR*, CHAR**)
    '
    IOData/directory.cpp:195: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'BOOL DeleteFileA(const CHAR*)'
    IOData/directory.cpp:215: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'BOOL RemoveDirectoryA(const CHAR*)'
    IOData/directory.cpp: In static member function 'static bool CL_Directory::set_c
    urrent(const CL_String&)':
    IOData/directory.cpp:224: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'BOOL SetCurrentDirectoryA(const CHAR*)'
    IOData/directory.cpp: In static member function 'static CL_String CL_Directory::
    get_appdata(const CL_StringRef&, const CL_StringRef&, const CL_StringRef&, bool)
    ':
    IOData/directory.cpp:253: error: 'SHGFP_TYPE_DEFAULT' was not declared in this s
    cope
    IOData/directory.cpp:266: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'BOOL CreateDirectoryA(const CHAR*, _SECURITY_ATTRIBUTES*)
    '
    IOData/directory.cpp: In static member function 'static CL_String CL_Directory::
    get_local_appdata(const CL_StringRef&, const CL_StringRef&, const CL_StringRef&,
    bool)':
    IOData/directory.cpp:316: error: 'SHGFP_TYPE_DEFAULT' was not declared in this s
    cope
    IOData/directory.cpp:329: error: cannot convert 'const wchar_t*' to 'const CHAR*
    ' for argument '1' to 'BOOL CreateDirectoryA(const CHAR*, _SECURITY_ATTRIBUTES*)
    '
    make[2]: *** [IOData/libclan22Core_la-directory.lo] Error 1
    make[2]: Leaving directory `/e/inst/pr/c/lib/gfx/ClanLib/ClanLib-2.2.1/Sources/C
    ore'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/e/inst/pr/c/lib/gfx/ClanLib/ClanLib-2.2.1/Sources'
    make: *** [all-recursive] Error 1
    Any ideas, guys?

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    It would appear that UNICODE is not defined. That then causes the Windows headers to chose the ANSI version of GetFullPathName instead of the unicode version.

  3. #3

    Default

    Great idea! Thanks!
    So how to solve a problem?
    Where to define UNICODE?

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Have a look at configure.ac, it contains:


    Code:
    case $target in
    	*cygwin* )
    		X11="no"
    		WIN32="yes"
    		CXXFLAGS="$CXXFLAGS -mno-cygwin -DWIN32"
    		;;
    	*mingw*)
    		X11="no"
    		WIN32="yes"
    		;;
    	*)
    		X11="yes"
    		WIN32="no"
    		;;
    esac
    I guess, add:
    CXXFLAGS="$CXXFLAGS -DWIN32 -DUNICODE"
    In the mingw switch

    Note, you are you only person I know that is attempting to compile clanlib 2 using mingw Let us know how you get on

Similar Threads

  1. Taking a CL_SharedPtr<Foo const> from a CL_SharedPtr<Foo>?
    By logixoul in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 04-19-2010, 10:27 AM
  2. How I make a "text" object with custom font?
    By speeder in forum Novashell Game Creation System
    Replies: 1
    Last Post: 04-10-2010, 02:23 AM
  3. Pilgrimís Quest: Problem in "Welcome to Fire woods!"
    By Floater in forum Dink Smallwood HD
    Replies: 0
    Last Post: 08-18-2009, 06:07 PM
  4. Multiple "keydown" signals on a single keystroke
    By zag in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 10-19-2008, 11:04 PM
  5. Di-Mart Guns -Explanation of the "Store Guy" event
    By rmcnew in forum Funeral Quest
    Replies: 2
    Last Post: 01-15-2004, 06:25 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •