I want to use flatc on a Windows machine and setting up the toolchain is cruel. I don't want to install Visual Studio, so I gave a shot at MinGW+CMake, which isn't a pleasant experience either.
Here's what I got in the end:
s:\git\flatbuffers>cmake -G "MinGW Makefiles"
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: S:/git/flatbuffers
s:\git\flatbuffers>mingw32-make
Scanning dependencies of target flatc
[ 7%] Building CXX object CMakeFiles/flatc.dir/src/idl_parser.cpp.obj
[ 15%] Building CXX object CMakeFiles/flatc.dir/src/idl_gen_cpp.cpp.obj
[ 23%] Building CXX object CMakeFiles/flatc.dir/src/idl_gen_java.cpp.obj
In file included from c:\mingw\include\direct.h:34:0,
from S:\git\flatbuffers\src\idl_gen_java.cpp:24:
c:\mingw\include\io.h:301:14: error: 'off64_t' does not name a type
__CRT_INLINE off64_t lseek64 (int, off64_t, int);
^
c:\mingw\include\io.h:302:14: error: 'off64_t' does not name a type
__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) {
^
CMakeFiles\flatc.dir\build.make:102: recipe for target 'CMakeFiles/flatc.dir/src/idl_gen_java.cpp.obj' failed
mingw32-make[2]: *** [CMakeFiles/flatc.dir/src/idl_gen_java.cpp.obj] Error 1
CMakeFiles\Makefile2:59: recipe for target 'CMakeFiles/flatc.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/flatc.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Again, I strongly propose offering a prebuild exe for Windows. Nevertheless, I also welcome some help on that off64_t issue.
Thanks,
Markus