Link to home
Start Free TrialLog in
Avatar of PNRT
PNRT

asked on

C++ dll will not run on machine without VS installed

Hi Experts
I have a C++ dll that changes printer settings and a VB.Net front end.  The dll is referenced in VB
If I place the VB exe and the dll in the same folder on my development machine it works fine.
If I copy the folder to another PC with VS installed it works fine without changing or installing anything else
If I add the folder to a PC without VS a get the jit box saying it cannot find the dll or dependencies
If I install VS on the same PC it then works
If I uninstall VS from the PC it then fails
I have tried installing all the C++ redistributables but it makes no difference if I install them or uninstall them  
I do not have access to the dll code
I tried uninstalling all the elements of VS to see what was causing the problem but it only failed when the actual VS app was uninstalled.
Can anyone help??  Please??
Avatar of Zoppo
Zoppo
Flag of Germany image

Hi PNRT,

usually it should be ok to install the correct VC Runtime Redistributables in order to resolve missing dependencies - if it does not work you probably use some DLLs in your VS project which are not part of the redistributables, this i.e. happens when you use Debug-DLLs of C-Runtime or MFC, so you should ensure you use builds from Release-configuration only.

If this doesn't help you should try to find out which DLL(s) are missing - to do this you can use the tool 'Dependency Walker' from http://www.dependencywalker.com/

Hope this helps,

ZOPPO
I guess this is a DEBUG build, the necessary dll's are NOT part of the C runtime redistributable.  Where did you get the dll from, maybe get in touch to confirm it is a RELEASE build.
Does the error message explicitely name the dll?

You might get a similar message if the framework is not installed on the computer, because one of the first thing a .NET application does is to check for mscorlib.dll, the heart of the framework.

Second thing is that if the dll is not a .NET dll, then it need to be registered through regsvr32 before it can be used on a computer. It is possible that installing VS does that, but your own application installation does not.
Avatar of PNRT
PNRT

ASKER

Hi James.  Thanks for the reply.
I previously installed .net 4.5 but no difference
I also thought of registering the dll but got the "Entrypoint DLLRegisterSrrvice was not found" error
SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PNRT

ASKER

Hi James
The error is that it is missing the actual dll or one of its dependencies
The actual dll is in the same folder (which works ok ona VS machine), so I gather its one
of the dependencies.   It doesn't stipulate.
I used dependencywalker as suggested by Zoppo above but the results were really confusing
showing hundreds of files and multiple errors.  Way beyond me I'm afraid.
I was hoping that as it worked OK on the VS machine, there was something simple that I could install to replace it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PNRT

ASKER

Trying hard Andy, no luck yet though!!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PNRT

ASKER

Apologies all.  Been trying to get the information from the dll's source.  No luck I'm afraid.  Taking up too much of my time to solve so found another solution.  Many thanks to all who tried to help.