From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-15-2013 03:30 AM
Hi,
i am using a dll (created in CVI) in my main project.
i have few project where i am using the same dll. problem is, every project i need to maintain a local copy of the dll which is not intended.
i need to maintain a single copy of the dll and i need to access from that path to all my projects.
even thought i have placed it in system 32 folder, my program is showing error as shown below
Project link errors
=>Failed to open ecternal module
=>aborted load of library "path\filename.lib"
1) is there any setting that i need to change for searching the dll path ?
2) how to tell the program to search the file in particular path? please tell the procedure
regards
phani
Solved! Go to Solution.
07-15-2013 09:25 AM
I think you are mixing dll and lib. You can place the dll in the system32 folder and it will be used when you run the application. The lib file is used when linking the program. Use add file to project and add the lib file to every project that is using the file for linking. Also configure include to search for the lib header file if required.
07-15-2013 12:38 PM - edited 07-15-2013 12:38 PM
You can read this help page that gives you some basic concepts about DLLs and corresponding LIB files.
07-16-2013 05:09 AM
Thanks for the response. It was really helpful.
I placed the *.dll file in system32 folder and I am able to run without any link errors.
I have few doubts in it.
I believe that *.lib file (related to *.dll file) should be present in every project I use.
1.) if at all I update the *.dll file, do I need to update the *.lib file in all project folder's??
2.) if I want to place that dll file in a separate folder (not system32) what procedure I should follow, so that my project will run without link errors??
3.) how can I use the loadlibrary command, so that I can access DLL's that are in other folders.
thanks in advance
phani
07-16-2013 06:40 AM
1) Do not place the lib file in every project folders. If you used the add file to project and added the lib file from the original lib project path, the correct lib file will be used. Remember to replace the old dll in the system32 with the new one. You can configure the project to copy the dll to system32 automatically.
2)Windows searches for DLLs several ways. The most common is to search application directory and system32.
3) You can add a path to the loadlibrary function (not recommended). If you use loadlibrary, you do not need the lib file, but you have to tell the linker how the functions you need from the dll looks like. This works like a plugin. The dll is not loaded before it is needed. Read documentation closely before using this function
07-16-2013 09:30 AM
Thanks
1) configure the project to copy the dll to system32 automatically : under target settings << where to copy DLL, I have selected Windows system directory. But while building the dll am getting the following error: Failed to copy "dll path" to "C:\windows\system32\testdll.dll" File access permission denied. But I have admin login to the test PC.
2)yes. I agree. it is accepting only in two ways for me. I) in the project path and system32 folder.
3) OK. Will I get a details procedure(steps to follow)?? do I need to change the code??
Thanks in advance
phani