meganz / sdk

MEGA C++ SDK
BSD 2-Clause "Simplified" License
1.33k stars 504 forks source link

Cannot compile under MSYS2 #2583

Open shiveringshivers opened 3 years ago

shiveringshivers commented 3 years ago

I'm trying to compile de mega sdk with MSYS2 32-bit in Windows 7, and I get this error after calling make:

make

make all-recursive make[1]: Entering directory '/d/mega' Making all in include make[2]: Entering directory '/d/mega/include' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/d/mega/include' make[2]: Entering directory '/d/mega' CXX examples/megacli-megacli.o In file included from D:/msys64/mingw32/include/zconf.h:475, from D:/msys64/mingw32/include/zlib.h:34, from ./include/mega/win32/meganet.h:26, from ./include/mega.h:74, from examples/megacli.cpp:22: ./include/mega/win32/megafs.h:176:10: error: 'bool mega::WinFileAccess::ftruncate64()' marked 'override', but does not override 176 | bool ftruncate() override; | ^~~~~ examples/megacli.cpp: In function 'int main()': examples/megacli.cpp:8482:12: error: 'CurlHttpIO' has not been declared 8482 | delete CurlHttpIO::sslMutexes; | ^~~~~~ make[2]: [Makefile:2830: examples/megacli-megacli.o] Error 1 make[2]: Leaving directory '/d/mega' make[1]: [Makefile:3382: all-recursive] Error 1 make[1]: Leaving directory '/d/mega' make: *** [Makefile:1533: all] Error 2

mattw-mega commented 3 years ago

There's no ftruncate64() in the SDK - do you have some sort of unfortunate macro active that is substituting that identifier in?

Also, for our own builds on windows we are using cmake for the SDK, and vcpkg for the dependencies. The build_from_scratch.cmake script captures all the steps. You might have an easier time using that too?

shiveringshivers commented 3 years ago

Honestly I don't know of any macro whatsoever. If it may be of any use, I'm posting the previous command I ran before make:

./configure --prefix=/d/libmega --without-freeimage --without-winhttp

configure: loading site script /mingw32/etc/config.site checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... none needed checking whether gcc understands -c and -o together... yes checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for wchar.h... yes checking for minix/config.h... no checking whether it is safe to define EXTENSIONS... yes checking whether _XOPEN_SOURCE should be defined... no checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports the include directive... yes (GNU style) checking whether make supports nested variables... yes checking dependency style of gcc... gcc3 checking build system type... i686-w64-mingw32 checking host system type... i686-w64-mingw32 checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe checking if the linker (D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /mingw32/bin/nm -B checking the name lister (/mingw32/bin/nm -B) interface... BSD nm checking whether ln -s works... no, using cp -pR checking the maximum length of command line arguments... 8192 checking how to convert i686-w64-mingw32 file names to i686-w64-mingw32 format... func_convert_file_msys_to_w32 checking how to convert i686-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32 checking for D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL checking for dlltool... dlltool checking how to associate runtime and link libraries... func_cygming_dll_for_implib checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /mingw32/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /usr/bin/dd checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 checking for mt... no checking if : is a manifest tool... no checking for dlfcn.h... no checking for as... as checking for dlltool... (cached) dlltool checking for objdump... (cached) objdump checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe) supports shared libraries... yes checking whether -lc should be explicitly linked in... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking for size_t... yes checking for uint8_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for pid_t... yes checking for off_t... yes checking for ssize_t... yes checking for g++... g++ checking whether the compiler supports GNU Objective C++... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking for g++... g++ checking whether the compiler supports GNU C++... yes checking whether g++ accepts -g... yes checking for g++ option to enable C++11 features... none needed checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe checking if the linker (D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe) is GNU ld... yes checking whether the g++ linker (D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe) supports shared libraries... yes checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (D:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking whether build environment is sane... yes checking for cppcheck... no checking whether g++ supports C++11 features by default... yes checking for egrep... (cached) /usr/bin/grep -E checking for egrep... (cached) /usr/bin/grep -E checking for _Bool... no checking for stdbool.h that conforms to C99... yes checking for dirent.h that defines DIR... yes checking for library containing opendir... none required checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... 64 checking for _LARGEFILE_SOURCE value needed for large files... no checking for off_t... (cached) yes checking size of uint64_t... 8 checking whether struct tm is in sys/time.h or time.h... time.h checking for off_t... (cached) yes checking for size_t... (cached) yes checking for arpa/inet.h... no checking for netdb.h... no checking for netinet/in.h... no checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for sys/socket.h... no checking for sys/timeb.h... yes checking for htonl... no checking for glob.h... no checking for malloc.h... yes checking for sys/malloc.h... no checking for malloc/malloc.h... no checking whether C++ compiler accepts -fPIC... yes checking whether the linker accepts -fPIC... yes checking for dlopen in -ldl... no checking for sys/inotify.h... no checking for mcheck.h... no checking for inotify_init1... no checking for fdopendir... no checking for select... no checking for sendfile in -lsendfile... no checking for socket in -lsocket... no checking for clock_gettime in -lrt... no checking platform options... yes checking for pthread_create in -lpthread... yes checking if building Java bindings... no checking for libcryptopp... --with-cryptopp not specified checking for cryptopp/cryptlib.h... yes checking for main in -lcryptopp... yes checking for libsodium... --with-sodium not specified checking for sodium.h... yes checking for sodium_init in -lsodium... yes checking for libpcrecpp... checking for libraw... checking for libraw/libraw.h... no configure: libraw/libraw.h header not found or not usable checking for libuv... --with-libuv not specified checking for uv.h... no checking for zlib... --with-zlib not specified checking for zlib.h... yes checking for main in -lz... yes checking for SQLite... --with-sqlite not specified configure: Using SQLite3 as the default DB access layer. checking for sqlite3.h... yes checking for sqlite3_open in -lsqlite3... yes checking for ffmpeg... --with-ffmpeg not specified checking for ffmpeg-mega/libavutil/macros.h... no checking for libavutil/macros.h... no checking for libzen... --with-libzen not specified checking for ZenLib/Ztring.h... no checking for pthread_create in -lpthread... (cached) yes libmediainfo requires libzen checking if building example applications... yes checking for FreeImage... no checking for PDFium... --with-pdfium not specified checking for fpdfview.h... no checking for termcap... --with-termcap not specified checking for tputs in -ltermcap... yes checking for Readline... --with-readline not specified checking for readline/readline.h... yes checking for rl_save_prompt in -lreadline... yes checking for FUSE... --with-fuse not specified checking for fuse.h... no checking for fuse_main in -lfuse... no checking for WinHTTP... no checking if building tests... no checking if building Python bindings... checking if building PHP bindings... no checking for main in -lstdc++fs... yes checking for doxygen... no configure: WARNING: doxygen not found - will not generate any doxygen documentation checking for perl... /usr/bin/perl checking that generated files are newer than configure... done checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating include/Makefile config.status: creating libmega.pc config.status: creating doc/Doxyfile config.status: creating include/mega/config.h config.status: executing depfiles commands config.status: executing libtool commands configure: Configured to build Mega SDK:

SDK version: 3.9.2 Host setup: i686-w64-mingw32 Install prefix: /d/libmega Compiler: g++ CXXFLAGS: -g -O2 -DNDEBUG=1 -fPIC -DUNICODE -DWINVER=0x0501 -DHAVE_STRUCT_TIMESPEC -DNOMINMAX -DMEGA_USE_C_ARES LDFLAGS: -lstdc++fs gcc hardening: no debug: no static: no sync subsystem: yes chat: no MEGA API yes example apps: yes Rot Perf Logger: no Drive Notif: no MEGA_USE_C_ARES: yes

inotify: yes posix threads: yes

Python bindings: no Python3 bindings: no PHP bindings: no SWIG_FLAGS_PHP:

Java bindings: no

OpenSSL: Crypto++: -lcryptopp Sodium: -lsodium Zlib: -lz SQLite3: -lsqlite3 c-ares: cURL: FreeImage: PDFium: Readline: -lreadline Termcap: -ltermcap PCRE: LIBUV: LIBRAW: LIBMEDIAINFO: FFMPEG: