Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problem deploying binary
I have MS Visual Studio 2005, on 32 bit WXP.

I created a simple C++ application.  It runs well and fast on my
machine.  However, when I copy the binary to another machine,  I get
the following error:

The system cannot execute the specified program.

This is silly.  It is a trivial, commandline program intended for
batch processing a few dozen files, using:

FinanceCPP "C:\\Work\\rdata31.dat" "C:\\Work\\output31.txt"

On my machine, that generates thousands of lines of output on standard
out and creates a plain text file with an equal number of lines (a
file a few hundred kBytes in size).

When I created it, I selected File->New_project, and then, under
Visual C++|General, I selected an empty project.  Did I need to do
anything else, in order to be able to just copy the resulting binary
to any other machine (running, say, 32 bit WXP, or 64 bit Windows
Server 2003)?  I'd didn't worry about even looking for DLLs since I
assumed any I'd need (such as the standard C library, and standard C++
library) would be part of Windows, or statically linked (since I did
nothing special, using only a couple math functions and iostreams).

I know the name of this group includes "dotnet", but in this specific
case, I am just trying to use VC++ to compile a plain old ANSI
standard C++ program (there's NOTHING in this that isn't part of the
ANSI C++ standard).  This isn't a language issue, but rather a what
did I miss in the use of the MSVS IDE issue.

I assume I have missed something simple, but I have yet to find what
that is.

Thanks,

Ted

Report this thread to moderator Post Follow-up to this message
Old Post
Ted
04-18-08 12:33 AM


Re: Problem deploying binary
>When I created it, I selected File->New_project, and then, under
>Visual C++|General, I selected an empty project.  Did I need to do
>anything else, in order to be able to just copy the resulting binary
>to any other machine

Change your project options to static link to the 'C' run-time
library. The default is to use the DLL version of the library which
means that you ought to install the VC++ run-time DLL as well as your
EXE. By static linking the run-time you'll only need your EXE.

The depends utility (www.dependencywalker.com) is an indispensable
tool for working out what dependencies your programs have.

Dave

Report this thread to moderator Post Follow-up to this message
Old Post
David Lowndes
04-18-08 12:33 AM


Re: Problem deploying binary
On 17 avr, 21:21, Ted <r.ted.by...@rogers.com> wrote:

>  =A0I'd didn't worry about even looking for DLLs since I
> assumed any I'd need (such as the standard C library, and standard C++
> library) would be part of Windows, or statically linked (since I did
> nothing special, using only a couple math functions and iostreams).

This is a wrong assumption : The C/C++ standard libraries come with
the compiler, they are not part of Windows. The default option for
Visual 2005 is to link against the DLL version of the CRT, which means
that you must distribute the DLL with your application.
If you want to link statically with the CRT (so that your app is self-
containing), change the option in the project settings (Configuration
Properties -> C/C++ -> Code Generation -> Runtime Library : Choose
"Multithreaded" for Release configuration and "Multithreaded Debug"
for Debug configuration)

As David said, Dependency Walker is very usefull to diagnose quickly
this kind of distribution problems.

Arnaud




Report this thread to moderator Post Follow-up to this message
Old Post
adebaene@club-internet.fr
04-18-08 10:04 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

VC++ archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:58 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.