473,396 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problems after compiling with Multithreaded-DLL runtime library

I am workin on a 2 part project right now. The first part is a DLL, the
second part a normal exe using that DLL.

When I use the VS2005 standard setting for compiling with the
Multithreaded-DLL runtime library (compiler option /MD )everything works
fine on my PC. But when I try to run the thing on a friends PC or my
laptop I get:

"This application has failed to start because the application
configuration is incorrect.
Reinstalling the application may fix this problem"

It works if I compile with (static)Multithreaded runtime-library
(compiler option /MT ) but of course that increases the file size
significantly.

Can someone enlighten me what the problem is here?
I always thought the only problem could be not having the MSVCR80.DLL
around, but my friend does have Visual studio 2005 installed just as I
do and copying that dll into the same folder doesn't help either.

Any help would be appreciated
Apr 11 '07 #1
9 3768
JS
I had a similar problem last week. Get the vcredist off of your
computer and install it on the other computer. Perhaps you have
VS2005 SP2 and the other computer does not have SP2. That was my
problem last week.
Apr 11 '07 #2
JS schrieb:
I had a similar problem last week. Get the vcredist off of your
computer and install it on the other computer. Perhaps you have
VS2005 SP2 and the other computer does not have SP2. That was my
problem last week.
I kinda want to write a DLL that can be used on any Windows Platform,
whether VS2005 is installed or not.
So that as a fact means that compiling with Multithreaded-DLL runtime
library is a No-Go for that, right?

What is that good for anyway? No user of the compiled programm will have
the runtime-DLL if he doesn't have Visual2005?
When is that compiler setting useful? Just for using it for testing?
I mean I can't always distribute the entire vcredist together with my
programs just so people can run them.
Apr 11 '07 #3
On 11 avr, 12:17, Andreas Schmitt <keldorkat...@gmx.dewrote:
JS schrieb:
I had a similar problem last week. Get the vcredist off of your
computer and install it on the other computer. Perhaps you have
VS2005 SP2 and the other computer does not have SP2. That was my
problem last week.

I kinda want to write a DLL that can be used on any Windows Platform,
whether VS2005 is installed or not.
So that as a fact means that compiling with Multithreaded-DLL runtime
library is a No-Go for that, right?
Not exactly.
If you compile against a DLL version of the CRT, you need to
redistribute it alongside your own binary.

When is that compiler setting useful?
Almost always. This is the recommended setting for several reasons
(eg, disk space, possibility fot the DLL to be "serviced" by Microsoft
in the case of a security patch, etc....)
Just for using it for testing?
I mean I can't always distribute the entire vcredist together with my
programs just so people can run them.
Why not?

Anyway, it all depends on how you redistribute your soft.
If you have a setup for your app, you can integrate the CRT within the
setup (the MSMs are installed on your dev machine when you install/
update Visual Studio 2005).

On the other hand, if you absolutely want to be able to distribute
your app by simple copy, then you need either :
- to redistribute vcredist.exe and have the user launch it.
- to copy the content of <Visual Studio Install Path>\VC\redist
\x86\Microsoft.VC80.CRT alongside your binary (in the same directory).
- to link statically against the CRT.

2nd and 3rd options are easier, but they are less recommended because
they do not allow the CRT to be serviced by MS in case of a security
breach.

Arnaud
MVP - VC
Apr 11 '07 #4
ad******@club-internet.fr schrieb:
>When is that compiler setting useful?
Almost always. This is the recommended setting for several reasons
(eg, disk space, possibility fot the DLL to be "serviced" by Microsoft
in the case of a security patch, etc....)
>Just for using it for testing?
I mean I can't always distribute the entire vcredist together with my
programs just so people can run them.
Why not?

Anyway, it all depends on how you redistribute your soft.
If you have a setup for your app, you can integrate the CRT within the
setup (the MSMs are installed on your dev machine when you install/
update Visual Studio 2005).

On the other hand, if you absolutely want to be able to distribute
your app by simple copy, then you need either :
- to redistribute vcredist.exe and have the user launch it.
- to copy the content of <Visual Studio Install Path>\VC\redist
\x86\Microsoft.VC80.CRT alongside your binary (in the same directory).
- to link statically against the CRT.

2nd and 3rd options are easier, but they are less recommended because
they do not allow the CRT to be serviced by MS in case of a security
breach.
I see. Thanks for clearing that up. I was always wondering what this was
really for and when it was used.
And I never noticed before that those DLLs were distributed with several
games I own. I found a msvcr71.dll in my SIlent Hunter directory for
example.
But it seems that now I also have to copy not only the dlls but also the
..manifest file?
So to get such an application to run I need to copy

Microsoft.VC80.CRT.manifest
msvcm80.dll
msvcp80.dll
msvcr80.dll

into the application directory. Is that correct?
Apr 11 '07 #5
In article <ev*************@news.t-online.com>,
Andreas Schmitt <ke**********@gmx.dewrote:
>What is that good for anyway? No user of the compiled programm will have
the runtime-DLL if he doesn't have Visual2005?
When is that compiler setting useful? Just for using it for testing?
I mean I can't always distribute the entire vcredist together with my
programs just so people can run them.
If you're just using C/C++, you can avoid all this nonsense by
turning off 'Manifest' files. (Frankly, I feel that manifests are a
half-baked solution to a problem, as they cause MUCH more problems
than it's worth. Maybe in the next version of VS.NET, manifests won't
cause major headaches like this.). To turn off manifests, just do the
following:

- Right-click on your exe's project in the solution explorer, select
Properties.
- Under Configuration Properties -Linker -Manifest File, set
'Generate Manifest' to NO.
- Under Configuration Properties -Manifest Tool -Input and Output,
set 'Embed Manifest' to NO.

Eventually, I feel that manifests may well be useful. It's typical
for MS software to be decent around version 3.0. But, I feel that
manifests are something that slipped out the door well before v1.0.

Nathan Mates

--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Apr 11 '07 #6
Nathan Mates schrieb:
If you're just using C/C++, you can avoid all this nonsense by
turning off 'Manifest' files. (Frankly, I feel that manifests are a
half-baked solution to a problem, as they cause MUCH more problems
than it's worth. Maybe in the next version of VS.NET, manifests won't
cause major headaches like this.). To turn off manifests, just do the
following:

- Right-click on your exe's project in the solution explorer, select
Properties.
- Under Configuration Properties -Linker -Manifest File, set
'Generate Manifest' to NO.
- Under Configuration Properties -Manifest Tool -Input and Output,
set 'Embed Manifest' to NO.

Eventually, I feel that manifests may well be useful. It's typical
for MS software to be decent around version 3.0. But, I feel that
manifests are something that slipped out the door well before v1.0.
What does the binary's manifest have to do with runtime-library dependency?
Apr 11 '07 #7
In article <ev*************@news.t-online.com>,
Andreas Schmitt <ke**********@gmx.dewrote:
>Nathan Mates schrieb:
> If you're just using C/C++, you can avoid all this nonsense by
turning off 'Manifest' files.
[...]
> Eventually, I feel that manifests may well be useful. It's typical
for MS software to be decent around version 3.0. But, I feel that
manifests are something that slipped out the door well before v1.0.
>What does the binary's manifest have to do with runtime-library dependency?
The manifest tells the OS (well, XP and up, Win2000 and before
ignore it, proving once again that Win2000 is one of the best things
to ever come out of MS) exactly what runtime-libs it needs. If there's
no manifest, it falls back on the usual "find a DLL by name" that
everyone knows how to work since Windows 3.x. I would consider
manifests *FAR* less broken if they'd fall back on the "find a DLL by
name" behavior if the precise version isn't there. Basically, if
things don't *work*, out of the box, for most people, then they're not
ready yet for public use.

Nathan Mates
--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Apr 11 '07 #8
Nathan Mates schrieb:
The manifest tells the OS (well, XP and up, Win2000 and before
ignore it, proving once again that Win2000 is one of the best things
to ever come out of MS) exactly what runtime-libs it needs. If there's
no manifest, it falls back on the usual "find a DLL by name" that
everyone knows how to work since Windows 3.x.
That doesn't change anything about the fact that the binary will still
need the DLLs...
Apr 11 '07 #9

"Andreas Schmitt" <ke**********@gmx.dea écrit dans le message de news:
ev*************@news.t-online.com...
ad******@club-internet.fr schrieb:
>>When is that compiler setting useful?
Almost always. This is the recommended setting for several reasons
(eg, disk space, possibility fot the DLL to be "serviced" by Microsoft
in the case of a security patch, etc....)
>>Just for using it for testing?
I mean I can't always distribute the entire vcredist together with my
programs just so people can run them.
Why not?

Anyway, it all depends on how you redistribute your soft.
If you have a setup for your app, you can integrate the CRT within the
setup (the MSMs are installed on your dev machine when you install/
update Visual Studio 2005).

On the other hand, if you absolutely want to be able to distribute
your app by simple copy, then you need either :
- to redistribute vcredist.exe and have the user launch it.
- to copy the content of <Visual Studio Install Path>\VC\redist
\x86\Microsoft.VC80.CRT alongside your binary (in the same directory).
- to link statically against the CRT.

2nd and 3rd options are easier, but they are less recommended because
they do not allow the CRT to be serviced by MS in case of a security
breach.

I see. Thanks for clearing that up. I was always wondering what this was
really for and when it was used.
And I never noticed before that those DLLs were distributed with several
games I own. I found a msvcr71.dll in my SIlent Hunter directory for
example.
Yeap. It means that Silent Hunter is compiled with Visual 2003.
But it seems that now I also have to copy not only the dlls but also the
.manifest file?
Yes, that's new with Visual 2005 : The CRT are signed and use the
side-by-side feaure of recent OSes (Windows XP and up). See
http://msdn2.microsoft.com/en-us/lib...24(VS.80).aspx.

For a complete overview of the deployement of Visual C++ applications, see
http://msdn2.microsoft.com/en-us/lib...k9(VS.80).aspx
So to get such an application to run I need to copy

Microsoft.VC80.CRT.manifest
msvcm80.dll
msvcp80.dll
msvcr80.dll

into the application directory. Is that correct?
Yes, this is one option.

The best solution on the other hand is to have the DLLs installed in the SxS
directory (side-by-side DLL cache). This can be done :
- by running vcredist.exe
- through the Microsoft_VC80_CRT MSM that is in C:\Program Files\Common
Files\Merge Modules on your developpement machine. This last option requires
that the MSM is integrated in an MSI setup (either buid a "Setup" project in
Visual 2005, either se a 3rd party yool such as InstallShield).

Arnaud
MVP - VC
Apr 11 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Olaf Meyer | last post by:
I'm having some problems compiling Python 2.3.3 on HP-UX (B.11.00). I've tried sevral different options for the configure script (e.g. enabling/disabling gcc, aCC) but I always get the same problem...
1
by: Elbert Lev | last post by:
I started with Python two weeks ago and already saved some time and efforts while writing 2 programs: 1. database extraction and backup tool, which runs once a month and creates a snapshot of...
11
by: Arturo DiDonna | last post by:
Hello everyone. I am trying to compile someone else code and I am stuck with compilation problems using the g++ 3.3 compiler. Basically, when compiling the following code, I get this error...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
2
by: ivan.pavlov | last post by:
I am running Debian/Linux unstable. Trying to upgrade packages depending on python (via aptitude) has started to give errors and leaves all packeges unconfigured. When I run dpkg --configure...
3
by: groups | last post by:
Hi all, I've recently ported a rather large C application to run multithreaded. A few functions have seriously deteriorated in performance, in particular when accessing a rather large global...
10
by: Flavio | last post by:
Hi, I try to write here because maybe my problem is a common one. I have a rather complicated multithreaded program, which uses the POSIX pthread standard. A master routine calls a series of...
3
by: | last post by:
Is it possible to have just a multithreaded sub procedure? What I need is a timer time_elapsed event (2 sec interval) send params to a sub that is multithreaded. I have a COM component used to...
3
by: Jake K | last post by:
I have a multithreaded application that I now want to convert into a Windows Service. Does application.run work in a windows service? Are there things to take into consideration when creating a...
4
by: vmpstr | last post by:
Hi, I am working on a multithreaded application, which also happens to use STL quite heavily. I'm running into the following problem (I'm sorry I can't post any code, because it is quite...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.