DLL Problems

Started by
3 comments, last by Drezard 15 years, 10 months ago
I'm trying to learn about all the wonders of DLLs currently and creating them using VC++ 2008. Now... I have successfully created my first .dll and linked it and got it working with my first project. BUT.... When I run it on my computer it works like a charm, i can change the directory that the files are located (aslong as the .dll and .exe stay in the same directory) and it still works. But as soon as I swap it over to another PC, it fails when I try and run the .exe and gives the... "This application failed to start because the application configuration is incorrect. Reinstalling this application may correct the problem." I think its caused by my linking. In the .exe project, i linked the .dll by going into Project Settings > Configuration > Linker > General and then setting the "Additional Library Directories" to the macro "$(TargetDir)" and then going into Linker > Input under "Additional Dependencies" I put in "Operations.lib" (the name of my DLL is "Operations.dll"). No %#include <operations.h> in the application code. Any ideas whats wrong? Is the way I'm linking or another problem??? Thanks, Daniel
Advertisement
Does it work if you just have the EXE without a DLL? Sounds to me like you haven't installed the VC++ runtimes on the other PC.
Is there a way I can do it without installing the runtimes on the other PCs?

Gives same error if I try and run it without the dll in the same folder...
Quote:Original post by Drezard
Is there a way I can do it without installing the runtimes on the other PCs?
No*

* Yes, but it's a hell of a lot more hassle (It involves writing your own CRT libraries). Another alternative would be to statically link to the CRT, but that has it's own problems (Such as a massively increased EXE size).

I'd suggest just directing people to the online redist. package.
EDIT: Or the equivalent one for the version of Visual Studio you use.
Thanks heaps!

I understand now.

Cheers again!

This topic is closed to new replies.

Advertisement