MrBit
MrBit

Reputation: 300

FTDI Drivers and dll

i have a question about the types of files and folders which contains the cdm v2.10.00 whql certified.rar

In the rar there's 3 folders:

Static\i386, Static\amd64, i386, amd64

in a simple project with C++, How can i know from what folder must i take the ftd2xx.dll? I think ftd2xx.h is the same. But how about the dll? In Static folders there's only .lib files. For what use its the lib files?

Upvotes: 0

Views: 3059

Answers (2)

Breit
Breit

Reputation: 419

The API for the FTDI D2XX drivers comes in two versions and each version has a 32-bit and a 64-bit binary, as you might have guessed from the folders in the rar archive:

Static\i386, Static\amd64, i386, amd64

Here is how you use them:

  • i386: This is the 32-bit dynamic linkage version. Just specify the .lib file inside this folder in your additional dependencies linker parameter and also specify the path to it under 'additional library directories'. Also make sure your compiled code (.dll or .exe) has access to the ftd2xx.dll file.
  • amd64: This is the 64-bit dynamic linkage version. Use it the same way as the 32-bit version in your 64-bit builds.
  • Static/i386: As the directory name implies, this is the static linkage version for 32-bit. Include the .lib the same way as for the dynamic linkage version, except that this time, you don't need the ftd2xx.dll. Instead specify FTD2XX_STATIC as a preprocessor definition in your project settings. I also want to point out that this static version of the FTDI D2XX API is linked to the release version of the runtime library, so it may only be functional in release builds.
  • Static/amd64: The same as Static/i386, except that this is the 64-bit static linkage version. Again: No DLL, but FTD2XX_STATIC needs to be defined and only linked against the release version of the runtime library.

Keep in mind, that for all these versions, you use the same header file ftd2xx.h from the archive.

Upvotes: 1

wimh
wimh

Reputation: 15232

if you create 32-bit software, you have to use the i386 version, if you create 64-bit software, use the amd64 version.

The .lib in the static folders, is when you static link. The .dll is for dynamic linking. That means if you distribute your software, you must distribute the dll too. The static version will everything inside the .exe you create.

There should be some documentation where this is explained. You probably need to #define something depending on whether you use the static or dynamic version. (unless the .h is not 100% identical, then you simply choose the corresponding .h file).

Upvotes: 0

Related Questions