compile vista cygwin

Issue #14 resolved
Anonymous created an issue

On windows cygwin (vista) after following the ./autogen and ./configure steps I get the following error with make.



$ make g++ -DHAVE_CONFIG_H -I. -I./src -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -g -O 2 -Wall -c -o src/util.o src/util.cpp src/util.cpp: In function off_t findFileSize(const char*)': src/util.cpp:49: error: aggregate_stat fileStats' has incomplete type and cann ot be defined src/util.cpp:50: error: _wstat' undeclared (first use this function) src/util.cpp:50: error: (Each undeclared identifier is reported only once for ea ch function it appears in.) src/util.cpp: In functionFILE APar_OpenFile(const char, const char)': src/util.cpp:84: error: _wfopen' undeclared (first use this function) src/util.cpp: In functionuint32_t APar_ReadFile(char, FILE, uint32_t)': src/util.cpp:262: error: call of overloaded `fseeko(FILE&, int, int)' is ambigu ous /usr/include/stdio.h:236: note: candidates are: int fseeko(FILE, off_t, int) src/util.cpp:143: note: int fseeko(FILE, uint64_t, int) make: *** [src/util.o] Error 1

}}} This is the code snippet: {{{


off_t findFileSize(const char *utf8_filepath) {

if defined (_WIN32)

if ( IsUnicodeWinOS() && UnicodeOutputStatus == WIN32_UTF16) {
    wchar_t* utf16_filepath = Convert_multibyteUTF8_to_wchar(utf8_filepath);

    struct _stat fileStats;
    _wstat(utf16_filepath, &fileStats);

    utf16_filepath = NULL;
    return fileStats.st_size;
} else



I'm probably missing something simple

Comments (4)

  1. Oleg Oshmyan
    • changed status to open

    Something is wrong on your side: Cygwin should not define _WIN32. If you prefer a quick but dirty fix, try adding this to src/config.h and then running make:

    #undef _WIN32
  2. Log in to comment