hi, i'm fresh in c++. i've just finish my first "big" program :). is it possible to make it and save it as self-starting one? maybe as .exe? to launch it on other PC without any compiliers?
i remember it was possible in VisBasic (but it was 10 yrs ago :)). i'm using now Visual C++ 2008 Express Ed.
thnx, rgds
Of course. If you ever executed your program before, there's already an .exe file somewhere in your project folder.
To make sure it runs on everywhere, you should link the CRT statically. I'd recommend Google for info on how to do that.
// MyReusableStaticSingleThreadReleaseLibrary.h
#if defined(_MT) || defined(_DEBUG)
#error The /ML compiler switch is required.
#endif
// MyReusableStaticMultithreadReleaseLibrary.h
#if !defined(_MT) || defined(_DLL) || defined(_DEBUG)
#error The /MT compiler switch is required.
#endif
// MyReusableDynamicLinkReleaseLibrary.h
#if !defined(_MT) || !defined(_DLL) || defined(_DEBUG)
#error The /MD compiler switch is required.
#endif
// MyReusableStaticSingleThreadDebugLibrary.h
#if defined(_MT) || !defined(_DEBUG)
#error The /MLd compiler switch is required.
#endif
// MyReusableStaticMultithreadDebugLibrary.h
#if !defined(_MT) || defined(_DLL) || !defined(_DEBUG)
#error The /MTd compiler switch is required.
#endif
// MyReusableDynamicLinkDebugLibrary.h
#if !defined(_MT) || !defined(_DLL) || !defined(_DEBUG)
#error The /MDd compiler switch is required.
#endif
aaaand? what next? only to add this file and what about step by step instruction? and what about this .exe file? my program's name is 'Proby' so i should find Proby.exe and to post to other pc? :) noo, too easy :)
is it possible to make it and save it as self-starting one? maybe as .exe? to launch it on other PC without any compiliers?
That depends on the compiler (settings) and objects linked, somethimes you'll need dll's that are by default on the most systems, but not always. I'f I compile a program on Windows 7 and run it on xp, I seem to miss a .dll file.
yes, i was happy too early. :( it's running only on my xp, i tried on vista and: "paraller configuration is not corrected' or somethin like this... so, it's still not solved. but you said it depends on compiler, my is Visual C++ 2008 Express Ed., and linked objects (that means libraries?) , i have like these: #include <iostream>
#include <cstdlib>
#include <conio.h>
#include "kroki.h"
and all files are four inc. h.file and main.cpp.. could you show me step-by-step instruction to prepare the self-extr file?
Edit: when you give your program to other people, you should give them the Release version, not the Debug one.
The Debug version is much slower and its executable file is several times larger.