Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ builder how to configure compiler to output just exe?

the question is how to configure in c++ builder 2010 compiler and debug option to output just one exe file, and all the other inside of that, so that i can easily use program on other maschine without installing them, with just runing exe file.

like image 622
raptor Avatar asked Dec 05 '10 22:12

raptor


People also ask

Does compiler generate executable code?

The generated code is usually loaded into the flash program memory of the target microcontroller. Similarly, compilers generate executable code from high-level language programs.

Can C++ be compiled to EXE?

Run the command to compile your program.Type g++ yourprogram. cpp (replace that name with the name of your actual CPP file) and press ↵ Enter to compile your CPP file into an EXE. As long as there are no errors in your C++ code, a new file ending in "EXE" will appear in the current folder.

Can G ++ compile C code?

gcc is used to compile C program. g++ can compile any . c or . cpp files but they will be treated as C++ files only.


2 Answers

With all versions of C++Builder you don't need to make an installer for this, (although inno setup is simply brilliant if you do require one).

Just select the following project options:-

  • Project/Packages:, Build with Runtime Packages = DISABLED
  • C++/Linker: Dynamic RTL = FALSE

That's it. You will get a single exe with no dependencies (apart from any 3rd party DLL's you use. All your VCL components (including third party ones) will get statically linked.

I use this mode for all production builds (although I do then use Inno Setup installer to manage the install/removal process for customers).

like image 95
Roddy Avatar answered Sep 28 '22 11:09

Roddy


In addition to Roddy's answer:
Do not forget to disable CodeGuard (Project->Options->Codeguard) or your program will fail on any machine that does not has the CodeGuard DLL's installed !

like image 22
Cees Meijer Avatar answered Sep 28 '22 09:09

Cees Meijer