tags:

views:

66

answers:

4

Hi,

I asked this question earlier as well:

http://stackoverflow.com/questions/2773168/lnk2005-delete-already-defined-error-in-vc

The answer I got was that I should be using dynamic version of DLLs. I did that and it compiled fine. Now, but when I gave the exe to one of my colleagues to run, they told me - they can't run it as it requires some shared dll, so they need a static one. When I try to do static build then I get the error as mentioned in my previous link. Do, I need to provide some other file as well with exe. I have got .lib file as well in the build directory. Shall I provide taht one as well?

I can run it fine on my m/c in whichever directory I put it.

Any help is much appreciated as I am really stuck.

Thanks in advance, Suchita

A: 

They may just need to install the Visual Studio redistributable package for whichever version of Visual Studio you built with. You can download this from MS.

Vicky
Do, I need to install it on my m/c or anyone who uses this application needs to install it. But then I can't ask my customers to install some extra package on their m/c.
Anyone who uses the app needs to install it. You should ideally package the redistributable installer with your application in one installable package.
Vicky
Default
A: 

If you link to the dynamic RTL, the dynamic RTL must be present on the system you want to run your executable on. Install the redistributable package on those machines. An installer provided with your program would do this.

Unless you know very exactly what you're doing, you should not link to the static RTL when you link together different EXEs/DLLs.

sbi
+2  A: 

See Microsoft's Scenarios for Deployment Examples (this covers 2 and 3)

There are 3 ways

1) Install the Visual Studio redistributable package separately as @Vicky's answer

2) Build an install package including the Visual Studio redistributable package

3) Copy the C++ Dlls into the same directory as your app See heading Deploying Visual C++ library DLLs as private assemblies

Mark
A: 

Thanks Everyone. That was really very helpful.