10-25-2007 02:31 AM - edited 10-25-2007 02:31 AM
Message Edited by OleAndre on 10-25-2007 02:33 AM
10-25-2007 07:47 AM
10-25-2007 08:17 AM
10-25-2007 01:23 PM
Ole,
The enum is NOT part of the public interface of the driver. It is part of the implementation and there is no requirement that identifier names be unique in the implementation across drivers. You are running into this problem because you are statically compiling the driver source from multiple drivers into your application which is not the correct thing to do.
You should link to the driver using its import library (.lib) or function panel (.fp) file. This way your application will load and execute the driver's DLL at runtime. Any updates/fixes to the driver will not require a recompile of your application, only an upgrade of the driver.
An IVI driver is meant to be compiled as a standalone DLL. If you want to statically compile multiple IVI drivers into your application, then you are responsible for making any modifications to your source code to make it work. This use case is not supported.
The attached project demonstrates that you can successfully build a project that uses both drivers by dynamically linking.
z_haider
10-25-2007 01:32 PM
10-26-2007 03:36 AM
Hi, z_haider.
Thank you for your clarification. Your points really makes sense. I was not really aware of how the compiler differ in behaviour wether the source is statically included in the project or not.
However, at this point I am not sure what I am doing wrong because what you describe is exactly how I have implemented the drivers already. That is; Loaded the instruments from .fp files. Not included any driver .c files in the project.
I don't know why the compiler still references the driver .c file.
10-26-2007 04:42 AM - edited 10-26-2007 04:42 AM
Message Edited by OleAndre on 10-26-2007 04:43 AM
10-26-2007 11:34 AM
10-29-2007 03:07 AM
Hi.
I can confirm that my drivers are NOT in the default installation directories as all drivers are placed in a common project directory.
What you are saying, that function panels will attach to the c-file IF the lib-file is not found is probably what happened in my case. As when I started working on the project (which was already started by someone else) the lib-file was not included in the project directory and naturally the function panel could not find it thus attaching to the c-file instead (without any notice).
When I added the lib-file to the project a popup appeared asking if I wanted to attach that file to the function panel instead of the c-file. I then assumed that the lib-file had to be included. However I tried now to remove the lib-file from the project, unload the instrument and then load it again and it attaches to the lib-file.
10-29-2007 11:42 AM