0

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?

MrBit
  • 290
  • 4
  • 20

2 Answers2

1

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.

Breit
  • 399
  • 5
  • 9
0

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).

wimh
  • 15,072
  • 6
  • 47
  • 98
  • i used this rar except from my program and for driver installing. http://www.ftdichip.com/Support/Documents/AppNotes/AN_234_FTDI_Drivers_Installation_Guide_for_Windows_8.pdf see page 9 and 10. I selected the whole folder for manual installing and device working fine! Finaly i want to learn about dll files which contains in this folder to learn to make project from zero without using examples – MrBit Aug 19 '14 at 18:59
  • How can i secify whether i use static or dynamic version? – MrBit Aug 19 '14 at 19:03
  • About "driver manual installing": is there something important i should notice? Is there any relation-connection between drivers and dll version which i use? – MrBit Aug 19 '14 at 19:10
  • about static vs dynamic, you can choose, just pick one, it is easy to switch later. See for example [Static linking vs dynamic linking](http://stackoverflow.com/q/1993390/33499) for more information. I did not look at the download, but you have to verify of the .h files are really identical (using file compare tool). If they are identical, there must be somewhere explained what you have to do in your source code to choose between static or dynamic linking. I don't know anything about the ftdi drivers (your question was not really ftdi specific - lib and dll files are everywhere). – wimh Aug 19 '14 at 20:41
  • there's only one .h file. Also i dont know how exactly can i decide between dll and lib linking. I knew that the .lib files it's necessary to link to your dll files. So, can i use dll without .lib in my project? – MrBit Aug 19 '14 at 20:54
  • The header (.h) files are for communicate in both files? lib and dll? In this case: It is necessary to use ftd2xx.lib file with my ftd2xx.dll?? – MrBit Aug 19 '14 at 20:56
  • If there is also a .lib file with the .dll, it is a import library. Then you can simply choose which lib file you use, depending on static or dynamic linking. And yes, one .h file could be sufficient. – wimh Aug 19 '14 at 21:12
  • There's one lib file in each folder. One in i386 and one in amd64. With dlls together. Also in static folders there's only lib files nothing more. And I don't know what can I do with lib files and who dll must I choose. That's all – MrBit Aug 19 '14 at 21:27
  • I prefer top make dynamic linking. Using dll. How can I define a dynamic linking? I was use dll with header only and it works. Is this right? Without lib file? – MrBit Aug 19 '14 at 21:32
  • Then you have to link with the lib file that is stored together with the dll. – wimh Aug 20 '14 at 06:41
  • How can i do that? For example in Visual Studio? Usually i put the lib file with dll together (in the same folder). Am i right? – MrBit Aug 20 '14 at 08:46
  • You should really ask a separate more specific question, so others see your question too. Now I am the only one who reads your commenst. But see for example http://stackoverflow.com/q/495795/33499 – wimh Aug 20 '14 at 09:12