libftdi Archives

Subject: libftdi-0.20 crosscompile on Ubuntu 12.04 problem

From: Vaclav Peroutka <vaclavpe@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 05 Jun 2012 13:26:37 +0200 (CEST)
Hello,

I am trying to cross compile libftdi for Windows on Ubuntu Linux. My 
Toolchain-mingw32.cmake contains following:
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
#SET(LIBUSB_INCLUDE_DIR /media/sf_temp_VBox/libusbx-1.011/include/libusbx-1.0)
SET(LIBUSB_INCLUDE_DIR /usr/i586-mingw32msvc/include/ddk)
SET(LIBUSB_LIBRARIES 
/media/sf_temp_VBox/libusbx-1.011/MinGW32/static/libusb-1.0.a)
SET(CMAKE_FIND_ROOT_PATH  /usr/i586-mingw32msvc )
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

I run it and these are results:
$ cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/i586-mingw32msvc-gcc
-- Check for working C compiler: /usr/bin/i586-mingw32msvc-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i586-mingw32msvc-g++
-- Check for working CXX compiler: /usr/bin/i586-mingw32msvc-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Build type: Debug
-- Could NOT find Boost
-- Boost not found, won't build libftdi++
-- Could NOT find SWIG (missing:  SWIG_EXECUTABLE SWIG_DIR)
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
-- Not building python bindings
-- Building example programs.
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Not generating API documentation
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vaclavpe/projects/libftdi-0.20/build

then, make all:
$ make all
Scanning dependencies of target ftdi
[ 10%] Building C object src/CMakeFiles/ftdi.dir/ftdi.c.obj
In file included from /home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:36:
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.h:220: error: expected ‘{’ before 
‘;’ token
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.h:220: error: two or more data 
types in declaration specifiers
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.h:366: error: expected ‘{’ before 
‘)’ token
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.h:366: error: two or more data 
types in declaration specifiers
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.h:370: error: expected 
declaration specifiers or ‘...’ before ‘usb_dev_handle’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c: In function 
‘ftdi_usb_close_internal’:
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:68: warning: implicit 
declaration of function ‘usb_close’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c: In function ‘ftdi_init’:
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:103: error: expected identifier 
before ‘struct’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:104: error: ‘struct 
ftdi_context’ has no member named ‘index’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:105: error: ‘struct 
ftdi_context’ has no member named ‘in_ep’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:106: error: ‘struct 
ftdi_context’ has no member named ‘out_ep’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:107: error: ‘struct 
ftdi_context’ has no member named ‘bitbang_mode’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:109: error: ‘struct 
ftdi_context’ has no member named ‘error_str’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:120: error: ‘struct 
ftdi_context’ has no member named ‘async_usb_buffer_size’
/home/vaclavpe/projects/libftdi-0.20/src/ftdi.c:121: error: ‘struct 
ftdi_context’ has no member named ‘async_usb_buffer’

etc...

What am I doing wrong ?

I do not see anything bad in ftdi.h

Thank you for answer,
Vaclav

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread