LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Merge dll dependencies into output dll

Solved!
Go to solution

Hello,

 

I created a CVI project which generate an output dll : main_driver.dll

This dll uses low level dll : driver1.dll, driver2.dll...

 

When I generate my output dll : main_driver.dll, I still need to copy the low level dll to my output folder (low level dll are indicated as to be part of the DLL dependencies of the project).

This is not really convenient.

 

Is there a way to merge the low level dlls into my main dll (not to be viewable, not to copy many files when I export my dll to a program) ?

 

Thanks

Grégoire

0 Kudos
Message 1 of 6
(5,330 Views)

Are you using the deployment tool built into CVI (distribution editor)?

 

When deploying an application that uses DLL's, you can bundle all of them into a distribution kit so that when you install (run setup.exe) all of your second-level DLL's will get installed wherever you want them.

 

It's under the Build pull down menu, then the distributions entry.

 

 

0 Kudos
Message 2 of 6
(5,319 Views)

The only way to roll everything up into one DLL is to have the source code or object files and statically link things into your DLL.

 

If you don't have that, the only option is to distribute all of the DLLs. The best way to do that is as Menchar recommends, use the distribution kit tool to build an installer that copies everything for you. The nice thing about that is it also creates an un-install option making removal easier if you ever have to get the software off of a machine cleanly.

Message Edited by MJF on 04-14-2010 09:26 AM
Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 3 of 6
(5,304 Views)

Thanks for your two answers.

 

Yes I am using the kit editor to create my dll. Yes, I use static library as input for my low level dll (just include .lib file into the CVI project tree, that's it ?!). 

 

However, in my kit editor, I still have the "dependencies" line which asks for low level dll. Moreover, when I use my high level dll, low level dll are requested at startup of my main program.

 

I guess I have to look deeper on how to use dll as static library...

 

Thanks 

0 Kudos
Message 4 of 6
(5,298 Views)
Solution
Accepted by topic author Grégoire31

It seems to me you are misunderstanding what is being said here. If all you have is a DLL file and a .lib file, you still have to distribute the DLL file, there is no way around that. The .lib file only tells the compiler and linker how to resolve the function calls, it does not include code. To actually incorporate code into your DLL, you must have either the source code or object files along with the .lib files which you would add to your project and then the linker can include the necessary code into your DLL.

 

If you do not have source or object code, you have to distribute the DLLs. To do so, you have to edit your distribution kit configuration to include those DLLs in the kit.

Message Edited by MJF on 04-14-2010 09:53 AM
Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 5 of 6
(5,294 Views)

Thanks Martin,

 

Indeed, I do not have the source files. So, as you told me, I have to distribute the dll too.

 

Thanks

0 Kudos
Message 6 of 6
(5,274 Views)