The OpenOCD ./configure script fails to detect my ftd2xx shared library. The workaround I am using for now is to have the configure script call FT_GetVIDPID instead of the FT_GetLibraryVersion function when testing for the presence of the ftd2xx library. I’m not sure if this is a bug or is related to something that is wrong with my setup but maybe the details and “proofs” will shed some light on the issue.
I am using Fedora Core 10 and have the Amontec USB JTAG key for my JTAG interface. I pulled the recommended linux shared library directly from Amontec, placed a link to it in /usr/lib, and obtained the header file ‘ftd2xx.h’ from FTDI and placed it in /usr/include. After performing the OpenOCD ./bootstrap, I tried to configure with the following command line:
./configure --enable-ft2232_ftd2xx --enable-amtjtagaccel --with-ftd2xx-lib=shared
The configure step always failed to resolve the call to FT_GetLibraryVersion. As a simple check I searched for strings in ft2d2xx to see some of the public
functions:
strings libftd2xx.so.0.4.10 |grep FT_Get
From this I got many FT_ functions but there was no occurence of FT_GetLibraryVersion. I made a standalone program to mimic the temporary ‘conftest.c’ program built during the configuration phase:
#include <stdio.h>
#include <ftd2xx.h>
#define CALL_FT_LIB(x) FT_GetLibraryVersion( &(x) )
int main( int argc, char **argv )
{
DWORD x;
CALL_FT_LIB(x);
return 0;
}
When I ‘make’ the program, the call to the library is unresolved:
ftdi_tst.c:(.text+0x18): undefined reference to `FT_GetLibraryVersion’
However, if I call a different library function that was found in while searching for strings in the shared library, the make is successful:
#define CALL_FT_LIB(x) FT_GetVIDPID(&(x), &(x))
For now, I am assuming the FT_GetLibraryVersion function is not really accessible in the libftd2xx I obtained from Amontec. As a sanity check, I pointed the shared library link to a separate version of the shared library obtained from FTDI. This time, the string “FT_GetLibraryVersion” does occur in the library, however, the call is still unresolved at link time. In both cases, calling GT_GetVIDPID always worked while calling FT_GetLibraryVersion never worked.
If anyone can see what is wrong it would prevent me from having to kludge config.in.