libftdi Archives

Subject: Re: libusb_init and libusb_exit in libftdi-1.0

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sun, 19 Jun 2011 16:35:25 +0800
On Thu, Jun 16, 2011 at 4:34 AM, David Wiberg <dwiberg@xxxxxxxxx> wrote:
> I'm not sure if you want the code posted on the list or some pastebin
> but since it's quite small I'll post it here this time. It's the
> simple.c example modified to only perform init and deinit of the
> library.
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <ftdi.h>
>
> int main(void)
> {
>    int ret;
>    struct ftdi_context ftdic;
>    if (ftdi_init(&ftdic) < 0)
>    {
>        fprintf(stderr, "ftdi_init failed\n");
>        return EXIT_FAILURE;
>    }
>
>    ftdi_deinit(&ftdic);
>
>    return EXIT_SUCCESS;
> }
>

This is indeed true.

mcuee@ubuntu:~/Desktop/build/libftdi/test$ gcc
-I/usr/local/include/libftdi -I/usr/local/include/libusb-1.0 -o test
test.c -lftdi

mcuee@ubuntu:~/Desktop/build/libftdi/test$ ./test
Segmentation fault

-- 
Xiaofan

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

Current Thread