libftdi problem

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

libftdi problem

Postby milan » Aug 28th, '15, 17:55

I am trying to compile simple test program using libftdi driver for FTDI chips, but unsuccessfuly.
Part of code:
Code: Select all
/* hello-ftdi.c: flash LED connected between CTS and GND.
   This example uses the libftdi API.
   Minimal error checking; written for brevity, not durability. */
#include <stdio.h>
#include <ftdi.h>
#define LED 0x08  /* CTS (brown wire on FTDI cable) */
int main()
{........

Command and its failure:
Code: Select all
milan ~/CCPP $ gcc ftdi.c -o helloftdi
ftdi.c:6:18: fatal error: ftdi.h: File or directory does not exist
 #include <ftdi.h>
                  ^
compilation terminated.

And now little bit mismatch (for me)
Code: Select all
milan ~/CCPP $ urpmq libftdi1
Package with name libftdi1 does not exists
milan ~/CCPP $ urpmq libftdi1_2
libftdi1_2

ftdi.h located in /usr/include/libftdi1

mga5 specfile:
Code: Select all
%define api 1
%define major 2
%define libname %mklibname ftdi %{api} %{major}


1.Why must be there major2?
2.What is the solution for my program?

Thank You for answers, Milan
Asus K53S i5-2410M, 2,3GHz
RAM: 4GB; HDD: SSD Samsung EVO 500GB
Intel3000 Graphics + NVIDIA GT540M
Mageia 5, KDM&KDE4
User avatar
milan
 
Posts: 16
Joined: Jun 11th, '12, 15:06
Location: Levice, Slovakia

Re: libftdi problem

Postby doktor5000 » Aug 29th, '15, 20:13

milan wrote:Command and its failure:
Code: Select all
milan ~/CCPP $ gcc ftdi.c -o helloftdi
ftdi.c:6:18: fatal error: ftdi.h: File or directory does not exist
 #include <ftdi.h>
                  ^
compilation terminated.


You're missing the package which includes the header ftdi.h, so search for that file:

Code: Select all
[doktor5000@Mageia5]─[20:06:49]─[~] urpmf ftdi.h                                                                                                                                                                 
lib64ftdi1-devel:/usr/include/libftdi1/ftdi.h
lib64ftdi1-devel:/usr/include/libftdi1/ftdi.hpp
lib64ftdi1-devel:/usr/share/doc/lib64ftdi1-devel/html/group__libftdi.html
lib64ftdi1-devel:/usr/share/doc/lib64ftdi1-devel/html/namespaceFtdi.html
lib64ftdi1-devel:/usr/share/man/man3/ftdi.h.3.xz
lib64ftdi1-devel:/usr/share/man/man3/ftdi.hpp.3.xz
libftdi1-devel:/usr/include/libftdi1/ftdi.h
libftdi1-devel:/usr/include/libftdi1/ftdi.hpp
libftdi1-devel:/usr/share/doc/libftdi1-devel/html/group__libftdi.html
libftdi1-devel:/usr/share/doc/libftdi1-devel/html/namespaceFtdi.html
libftdi1-devel:/usr/share/man/man3/ftdi.h.3.xz
libftdi1-devel:/usr/share/man/man3/ftdi.hpp.3.xz


milan wrote:And now little bit mismatch (for me)
Code: Select all
milan ~/CCPP $ urpmq libftdi1
Package with name libftdi1 does not exists
milan ~/CCPP $ urpmq libftdi1_2
libftdi1_2

ftdi.h located in /usr/include/libftdi1

What mismatch in particular?

milan wrote:mga5 specfile:
Code: Select all
%define api 1
%define major 2
%define libname %mklibname ftdi %{api} %{major}


1.Why must be there major2?
2.What is the solution for my program?

1. because the SONAME of that library has 2 as the major version.
Code: Select all
[doktor5000@Mageia5]─[20:11:01]─[~] objdump -ap /usr/lib64/libftdi1.so.2 | grep -i soname
  SONAME               libftdi1.so.2

2. install the package with the missing header file and compile again.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: libftdi problem

Postby milan » Aug 30th, '15, 07:21

1. Thank You for explaining, I didn´t know this.
2. libftdi1-devel was installed
Asus K53S i5-2410M, 2,3GHz
RAM: 4GB; HDD: SSD Samsung EVO 500GB
Intel3000 Graphics + NVIDIA GT540M
Mageia 5, KDM&KDE4
User avatar
milan
 
Posts: 16
Joined: Jun 11th, '12, 15:06
Location: Levice, Slovakia

Re: libftdi problem

Postby doktor5000 » Aug 30th, '15, 17:33

Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: libftdi problem

Postby milan » Aug 30th, '15, 18:36

Very sorry for this misunderstanding.
It was meant so that libftdi-devel was installed before compilation, so the problem persists.
The same problem I have with Pclos via Virtualbox, so I will try to find out any other solution.
Thank You
Asus K53S i5-2410M, 2,3GHz
RAM: 4GB; HDD: SSD Samsung EVO 500GB
Intel3000 Graphics + NVIDIA GT540M
Mageia 5, KDM&KDE4
User avatar
milan
 
Posts: 16
Joined: Jun 11th, '12, 15:06
Location: Levice, Slovakia


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron