-
When coding, we use the debug mode, and the debug version of the program is generated. After the program is written, it needs to be released, and the release version needs to be generated.
Above VS2008, you can see a drop-down list that says "debug", select "release", then recompile the project, and when you're done, you'll get the release version of the program. This program can be ported to other computers.
If the program uses a dynamic link library, etc., it is best to generate an installer to make it easier for the user to use. The simplest installer to generate is to right-click on "Solution***" in the left or right file list in VS, "Add", "New Project", "Other Project Types", "Install and Deploy", "Setup Wizard".
-
The compilation mode of VC is divided into two types: debug and release, that is, debug version and release version.
Generally, the version delivered to users is the release version, and the difference between the release version and the debug version is the compilation. The ** of the release version has undergone the greatest optimization (default), such as space optimization, execution efficiency optimization, and the exe file does not contain debugging information.
The debug version (default compilation, please compilation is required manually when releasing software) is mainly used for program debugging, in order to compile as fast as possible, so ** does not do any optimization by default, and the compiled exe file contains debugging information, which is why you can easily debug the program by using VC directly. Therefore, the execution efficiency of the debug program is low, the space utilization rate is not high, and the file size is large.
That's the difference between a release version and a debug version.
In fact, the program itself has little to do with the version, as long as there is a corresponding support library.
In fact, what the landlord asked was a question of publishing.
The recommended release method is to compile the program directly into the release version and release the VC runtime to the user, and the user first installs the VC runtime (some versions of the VC are slightly larger), and then installs their own program. Because this method is the simplest and can basically solve the problem, the average user can use it.
Of course, this also has some disadvantages, such as increasing the user's burden and increasing the size of the program.
When it comes to software release, there are of course other methods!
Here's a suggestion:
The MFC library is statically compiled into the program at compile time (dynamic compilation by default), which can free the program from the dependency of the VC's MFC runtime library (the disadvantage is that it increases the size of the program). If you write a console-based C C++ program, the standard library is also statically compiled into the program (default), because the C C++ standard library of VC is provided by dynamic library by default, and different versions of files are different, such as VC6, VC2005, VC2008, etc., so there is a dynamic library dependency problem, because the VC runtime library that comes with the Windows operating system by default cannot guarantee that it can support all VC versions.
-
There is a drop-down list box behind the launch debug button (green triangle) from which you can select release
-
vc2008?Or VC from VS2008
The compiled program should be required. .NET, i.e. the framework component needs to be installed.
-
After selecting the release, select build->rebuild solution to recompile.
-
Once you've set it up, you need to recompile it (build, clear, clean, rebuild, rebuildall), and then go to the release folder to find it.
-
The Project Settings General uses MFC as a static link library.
Second, assemble the project into a release
Set up Ming Brigade" Finger Fiber "Remove Project Configuration" win32-release, you can copy the exe file under the release folder to someone else's computer to run.
-
Installshield comes with this in the installation process.
Install it, you can use this as an installation package, and write scripts.
The net judgment is separate, and there should also be a lack of it.
-
Method steps.
Open VC++ and the interface is as follows, 2
Click "File - New" in the menu bar in the upper left corner to open the following interface.
At. Select "Win32 Console" from the list on the left
application", that is, win32 console project, the console is similar to the cmd window in windows, just start programming, choose to create this project. Enter the project on the right.
Name, I type "firstprogram" here, select a folder where the project is stored, if not placed under the default path, then click on the one on the right to display "..".button, and then customize the selection path, the path I chose was f: cpp.
Then click OK, select "An empty project" in the dialog box that appears, click Finish, and click "OK" in the subsequent window that appears.
This. An empty project is created, and our source file will be included in the project. We now start creating the source ** file, click on "File" in the upper left corner of the software - "New", and then.
When the dialog box you just saw appears, select "File" in the tab above, and then select "C++ Source" in the list below
file", enter the file name, and then click "OK".
After this is confirmed, the right area will automatically open a blank file, and the left workspace can also see the organization of the entire project.
Next, let's write a simple program that displays "hello world!" on the screen", the most classic program.
#include
using namespace std;
int main()
cout<<"hello world!";
return 0;
Then press the button above the area to compile, link, and then execute, as shown in the following figure.
The execution result is shown in the figure below, and a small program written by us in VC++ is successfully executed.
-
After generating the release, just give the exe file and dll to others, because you want to use the functions in the dll in your program, so you must give it to others, otherwise the program will report an error if it can't find the dll.
-
Publishing the exe is actually very simple, after the compilation is passed, you can find the exe file in the project folder debug folder (vs2008 file structure is a bit complicated, two debug folders will be found under the project folder, one of which has the exe file), you can use it directly. As for the runtime library problem, when creating a new project, it will let you choose a static link or a dynamic link, if you choose a dynamic link, you may need additional library files, but the advantage is that the exe file is small, and you don't need to consider the library problem if you choose the static way, and you can use it directly when you copy it to any Windows system (I haven't tried the version below XP), but the exe file is much larger.
-
After debugging, an executable file is generated, and it can be used.
-
To generate a release version, you need to set it up first
Select "Settings" in "Project" to open the Project Settings dialog box, first select Win32 Release in the "Settings" drop-down list, and then set it to "Use MFC as a static link library" on the right. Click OK.
Then open the "Batch Formation" under "Formation", check the win32 debug, and then click "Create". At this point, you should be able to generate a release version of the application.
This program can be copied directly to someone else's computer to run, no need to install VC, I believe you will be able to learn it
-
It's because you didn't make the installation file, when installing the VC, your machine has been installed with some VC required files, so you can use it directly on the machine, when you use someone else's machine, there are only two ways, the first is to install the VC and then run your program, the second is to make the installation file, give me a ** address to make the installer software.
-
Create a release version and you're good to go.
-
Your question is not clear.
I understand two aspects:
1. How to package the program?
2. Write another program to generate this program?
Answer: 1. First of all, compile the release version, and then use a packaging tool to package it, such as installshield pro, etc.
2. If you write a program to generate the current program, you generally treat the target program as a resource, and then release this resource and save it as a file in the specified directory.
-
You should know how to set up the project, right? If you want to publish, set it to the release version, and it is best to set the dynamic link library to static links and compile.
After the compilation is successful, the packaging can be used. istool.
-
<>). Dino can be contacted.
-
After writing a program, it needs to be compiled before it can be run, and the specific method is as follows:
Press F7 to build
After there are no errors, press Ctrl+F5, which is the exclamation point button.
-
Do you mean how the program runs or how it compiles after it is generated?
1.After the F5 is compiled, the program result can be directly run.
2.If the generated program is running, double-click the exe to execute; The dll and lib files cannot be run directly, and need to be loaded by other programs and carried for running.
I don't understand what you mean, just say something, I hope it helps you.
If you want the source**, I can make one and send it to you. >>>More
Some exe files are encrypted (packed), you can't see it directly, you have to unshell it first. >>>More
Upstairs ** is so long, it's still simple?
Speechless. I wrote one for you, this is really simple and practical, hehe! >>>More
Two commandbuttons, two lables, two texts"
private sub command1_click()r = >>>More