|
From: Xiaofan C. <xia...@gm...> - 2010-03-02 23:55:31
|
On Wed, Mar 3, 2010 at 7:26 AM, Graeme Gill <gr...@ar...> wrote: > I just tried to compile the latest code using MingW, and get the following > errors: > > Cc_ libusb\core.obj > In file included from libusb/libusb.h:24, > from libusb\/libusbi.h:30, > from libusb\core.c:31: > msvc/stdint.h:33:2: error: #error "Use this header only with Microsoft > Visual C++ compilers!" > It seems to me that Pete is using very recent version of MinGW installations and it took me quite sometime to be able to build under MinGW. I will think you have an old version of MinGW, libtool and auto-tools (autoconf, automake, etc). I think I still have one issue with MinGW which I have never been able to solved. But you can try. Go to: http://sourceforge.net/projects/mingw/files/ Upgrade to the latest version of MinGW using the automated installer 5.1.6 (base and Win32API, etc). Download all the MinGW version of the auto-tools (not the MSys version) and then try again. You also need MSys. My other solution is to use Linux MinGW cross compiling and it works fine. mcuee@ubuntu64:~/Desktop/build/libusb1/windows/libusb-pbatard$ ./autogen.sh --host=i586-mingw32msvc libtoolize: putting auxiliary files in `.'. libtoolize: copying file `./ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. libtoolize: copying file `m4/libtool.m4' libtoolize: copying file `m4/ltoptions.m4' libtoolize: copying file `m4/ltsugar.m4' libtoolize: copying file `m4/ltversion.m4' libtoolize: copying file `m4/lt~obsolete.m4' configure.ac:12: installing `./compile' configure.ac:10: installing `./config.guess' configure.ac:10: installing `./config.sub' configure.ac:2: installing `./install-sh' configure.ac:2: installing `./missing' examples/Makefile.am: installing `./depcomp' configure: WARNING: unrecognized options: --enable-maintainer-mode configure: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used. checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for i586-mingw32msvc-strip... i586-mingw32msvc-strip checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for i586-mingw32msvc-gcc... i586-mingw32msvc-gcc checking for C compiler default output file name... a.exe checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... .exe checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether i586-mingw32msvc-gcc accepts -g... yes checking for i586-mingw32msvc-gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of i586-mingw32msvc-gcc... gcc3 checking build system type... x86_64-unknown-linux-gnu checking host system type... i586-pc-mingw32msvc checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by i586-mingw32msvc-gcc... /usr/i586-mingw32msvc/bin/ld checking if the linker (/usr/i586-mingw32msvc/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/i586-mingw32msvc-nm -B checking the name lister (/usr/bin/i586-mingw32msvc-nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /usr/i586-mingw32msvc/bin/ld option to reload object files... -r checking for i586-mingw32msvc-objdump... i586-mingw32msvc-objdump checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL checking for i586-mingw32msvc-ar... i586-mingw32msvc-ar checking for i586-mingw32msvc-strip... (cached) i586-mingw32msvc-strip checking for i586-mingw32msvc-ranlib... i586-mingw32msvc-ranlib checking command to parse /usr/bin/i586-mingw32msvc-nm -B output from i586-mingw32msvc-gcc object... ok checking how to run the C preprocessor... i586-mingw32msvc-gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... no checking for objdir... .libs checking if i586-mingw32msvc-gcc supports -fno-rtti -fno-exceptions... no checking for i586-mingw32msvc-gcc option to produce PIC... -DDLL_EXPORT -DPIC checking if i586-mingw32msvc-gcc PIC flag -DDLL_EXPORT -DPIC works... yes checking if i586-mingw32msvc-gcc static flag -static works... yes checking if i586-mingw32msvc-gcc supports -c -o file.o... yes checking if i586-mingw32msvc-gcc supports -c -o file.o... (cached) yes checking whether the i586-mingw32msvc-gcc linker (/usr/i586-mingw32msvc/bin/ld) 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... yes checking for inline... inline checking whether i586-mingw32msvc-gcc and cc understand -c and -o together... yes checking operating system... Windows checking sys/timerfd.h usability... no checking sys/timerfd.h presence... no checking for sys/timerfd.h... no checking whether TFD_NONBLOCK is declared... no checking whether to use timerfd for timing... no (header not available) configure: creating ./config.status config.status: creating libusb-1.0.pc config.status: creating Makefile config.status: creating libusb/Makefile config.status: creating examples/Makefile config.status: creating doc/Makefile config.status: creating doc/doxygen.cfg config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands configure: WARNING: unrecognized options: --enable-maintainer-mode mcuee@ubuntu64:~/Desktop/build/libusb1/windows/libusb-pbatard$ make make all-recursive make[1]: Entering directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard' Making all in libusb make[2]: Entering directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard/libusb' CC libusb_1_0_la-core.lo CC libusb_1_0_la-descriptor.lo CC libusb_1_0_la-io.lo CC libusb_1_0_la-sync.lo CC libusb_1_0_la-threads_windows.lo CC libusb_1_0_la-poll_windows.lo CC libusb_1_0_la-windows_usb.lo CCLD libusb-1.0.la Creating library file: .libs/libusb-1.0.dll.a make[2]: Leaving directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard/libusb' Making all in doc make[2]: Entering directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard/doc' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard/doc' Making all in examples make[2]: Entering directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard/examples' CC xusb.o CCLD xusb.exe CC lsusb.o CCLD lsusb.exe CC dpfp.o CCLD dpfp.exe make[2]: Leaving directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard/examples' make[2]: Entering directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard' make[2]: Nothing to be done for `all-am'. make[2]: Leaving directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard' make[1]: Leaving directory `/home/mcuee/Desktop/build/libusb1/windows/libusb-pbatard' -- Xiaofan http://mcuee.blogspot.com |