Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
myapplication.exe
i have made a application on windows 7 with win 7 sdk but when i load it on new machine it says "Application has failed to start because side by side configuration is incorrect" i tried dependency walker and included same dll which it needs.

myDLL.dll
my dll works fine on my machine but not on new machine

i have tried
vcredist [nearly all] 86 ,64..
.net [3,4]

it runs when i install SDK for windows on that machine.

1 How can we include required dll in our application.exe?
2 can we run regsvr32 for dll to load?
Posted
Updated 29-May-11 6:28am
v2

1 solution

It sounds as if you have just copied your application to the new machine. The best solution is to create an installation package and install the application instead - the installation will then copy the required files to the correct place.

You haven't said which compiler you are using, if you are using a professional version of Visual Studio then you can create a deployment project[^].

However if you are using an Express version of Visual Studio, which doesn't support deployment projects, then you have more work to do. You can follow Microsoft's guidelines[^] but it seems that you have effectively tried this and failed. You could try one of the free installation creation tools, such as Inno Setup[^] or NSIS[^].

There is some guidance of NSIS in the Creating an Installer[^] CP article. Inno Setup is covered in the .NET Framework 1.1/2.0/3.5 Installer for InnoSetup[^] CP article

The alternative to proper installation of your application is to use static linking of the libraries used. This increases the size of your application, but should allow the application to be merely copied onto the target machine.
 
Share this answer
 
Comments
01.mandar 29-May-11 23:50pm    
thanks graham
my .exe and .dll(_stdcall) has same working code for serial port communication

i had created deployment setup from Visual Studio 2010 itself.
i tried coping 3 required dll file in setup
advapi32.dll, Kernel32.dll, msvcr90d.dll and my exe application as shown by dependency walker tree.

i have installed Platform SDK for win XP and WIN 7 both
i want to make it for winXP (my dll has lib function from WinXP Platform)

can i link statically all the dependent modules at compile time itself?
Graham Shanks 30-May-11 4:14am    
There are two places that you need to update in your project solution. The first, in the general tab will be the "use of MFC" tab - set this to "use MFC in a statiic library" (this will have no effect if you are not using MFC, but it will do no harm). The second, in the "Code Generation" tab, is the runtime library - set this to "Multi-threaded" for release builds and "Multi-threaded Debug" for debug builds.

Note: I've not got VS 2010 so exactly what the solution properties are named and where they are may vary from the above, but I think you should be able to find them from the above description.

If you've not added any libraries as additional dependencies then this should be it. If you have additional dependencies then you need to find the actual libraries, instead of the import libraries - this is library specific, so I'm not sure how much help I'll be there
01.mandar 1-Jun-11 9:50am    
thanks graham that worked !!
i am trying to load dll using JSctypes i hope it should not create any problem..

anyways thanks you saved lot of work.. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900