Category Archives: How to Fix

Solution of vs program flashback problem

As you would expect in the following program, the control is out of control in a flash after running, so we are now going to solve this problem in our code in the following ways

1. The getchar ()

This statement is to wait for user input, implementation program pause

2.system(“pause”)

This statement causes the system command program to pause, so adding this statement before return 0 causes the program to pause

3. The while (true)

This is easy to understand, but it may not be appropriate for some applications

4. Run the program using Ctrl+F5

In VS, because we built the project originally, it was an empty project

> Properties of the project> “Configuration properties”>> “linker”> Subsystem The item “subsystem” in “System” is changed to “Console”

After doing this, press Ctrl+F5 again and the program will end up in the console screen

The solution of flashing back after the end of console program running

If you compile successfully in the console program, flash back after display, you can not see the result of the situation, may be due to compiler configuration problems.
Solution:
The

    project – & gt; Property – & gt; Configure properties ->; The linker – & gt; System – & gt; Subsystem – & gt; SUBSYSTEM:CONSOLE adds “/SUBSYSTEM:CONSOLE” link option. Then start execution (without debugging).

    > You can also keep a console application on the console interface by using getchar or system (” pause “) at the end of the program. Do not append the final return statement. If not, exit. This will display “Press any key to continue..” or “Press any key to continue…” when running to this point. .

Flash back after vs compiler running, processing method

How to solve the problem of flash back!!!!!!
I habitually deal with this problem in three ways
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — –
1, system (” pause “);
2, getchar ();
3, Ctrl + F5
Let’s discuss the pros and cons of each separately: Welcome to the land of the Kings
System (” pause “) : need to include the preprocessing header #include< stdlib.h> ||#include< windows.h>
Usage: put return (); Before the return statement, otherwise there is no meaning
Advantages: solve the flashback problem, small side effects
Disadvantages: call system function, large memory overhead

Getchar () :

Usage: put return (); Before the return statement, otherwise there is no meaning
Advantages: low overhead, receive a character to end the program
Cons: Use it on a case-by-case basis, because getchar (); You need to accept a string to represent the end, and some functions explicitly need to accept a string as the return value, if you use getchar (); To solve the flashback problem, which can be confusing and introduce errors when the program is running.
can see, although can solve the running results of the flashback problem, but in the processing is completely different, although in the operation is also approximately the same, but in the memory, CPU and other levels, overhead is sometimes different, so you can choose according to your preferences for a way for you !!!!! System (” pause “) is recommended; This way, the introduction and processing of files is also more careful, if there is a heavy use of system functionality is, of course. windows.h> #include< stdlib.h> Of course, it is suitable for those who use a lot of library functions

 

Solution for iPhone wechat flash back with mysterious code

On the night of the 14th, many people appeared in their WeChat Momentals such as “When you click the full text on an iPhone, it will flash back.” There were several blank lines below, so you need to click “full text” to see it. However, once you click “original” on an iPhonWeChatB1, it will flash back directly, while there is no problem with Android phones.

In fact, there is a set of code hidden below this article, which is only available for iOS. But fortunately, this is just a flash back, will not appear WeChat can not open the situation. This is the code from two years ago. If an iPhone user receives this code, it will cause WeChat, Twitter, SMS, and other apps to crash or crash. The code exploits an iOS remote denial of service vulnerability, which has since been fixed, but now a new code has appeared that causes WeChat to flash back when the iPhone is turned on.)
WeChat ->; “I” – & gt; ‘My photo album’ -> Click “today” on the camera there and send a picture to restore it.
There is another method for flashback in Moments, you can clean up the WeChat cache in WeChat Settings – General, this operation will clear the Moments cache, can be restored, if click the Moments flashback again, it is proved that your friends have sent flashback characters.

C language — to solve the problem of program flashback when programming (in VS)

How can we make the application pause so that we can see the effect
First let’s use a simple program to explain the flashback problem, when we run the following program, we do not see the actual display effect
We can only see the result if we pause the program, so how do we pause the program?We will solve this problem in three ways.

Return 0; return 0; Add getchar() to the preceding line;
This function is waiting for input of a character, not input will always wait, so play a pause effect, to exit any key can!

View the results after running: press any key to exit after running

Return 0; return 0; I’m going to add while(1) to the front line;
Infinite loops don’t let you quit the program, you’re stuck here all the time, which is very useful. The only way to exit the program is to click the close button X in the black window in the upper right corner

View the results after running, only click the close button to end the program running.

Third, you need a special Windows header file and then add the statement system (” pause “).
Note: this method is more time-consuming, more harmful, try not to use this method

The result of operation,

 

In vs programming, the code of Ctrl + F5 is flashback

When VS compiles and runs the code, if there is no delay or some kind of response, the window will close immediately after running
Solution a:
in the main function and getchar ()

; add system(” pause “) to the main function
Solution 3:
right-click on the project, select properties, choose the linker, selection system, in the subsystem, the console this

the above methods are debug mode, the way of carrying the shortcut Ctrl + F5
in debug mode, just set a breakpoint in the main function, then one by one to debug

About adding legacy to linker additional dependencies_ stdio_ definitions.lib Solve the problem of incomplete standard library files

The C ++ file of VS2013 was reloaded with VS2017. The following problem was found
Error LNK2019 cannot resolve external symbol __imp__vsnprintf, which is referenced in the function __glfwinpuError
Error LNK2019 __imp__sscanf cannot resolve external symbols, the symbol referenced in the function __glfwRefreshContextAttribs
Method 1: Find a project in the VS2017 solution -> Properties in the linker ->;
> write #pragma comment(” legacy_stdio_defines.lib “) at the beginning of the startup file.
The reason for this problem is that many libraries are inline by default when VS2017 is compiled, so there are no library files to link to, so you have to specifically add library files to link to functions in the library
Attached link:
https://stackoverflow.com/questions/29556290/random-unresolved-external-symbols-that-shouldnt-be-there

OpenGL + vs2015 environment configuration problem solving

1. Compile-time prompts
“Error C2381: ‘exit’ : redefine; __declspec(noreturn) different “error

#include <; #include <; GL/glut.h>
# include & lt; stdlib.h>
:
include
:
#include
stdlib.h>
# include & lt; GL/glut.h>
to go through.

enGL and C++ have a bit of an incongruence. Include the standard C++ library header before the GLUT graphics library header.

2. Compile passed, runtime prompt
(1) ERROR LNK2019: Unable to resolve the external symbol __imp____glutInitWithExit@12, which is referenced in the function _glutInit_ATEXIT_HACK@8
(2) ERROR LNK2019: Unable to resolve the external symbol __imp____glutCreateWindowWithExit@8, which is referenced in the function _glutCreateWindow_ATEXIT_HACK@4

Solution:
The # include & lt; GL/glut.h> He added:
# define GLUT_DISABLE_ATEXIT_HACK
(!!!!!! Attention, the front!!)

Problems encountered in vs2015 configuration using OpenGL environment

With reference to some problems in the https://blog.csdn.net/xuguangsoft/article/details/8002375 configuration opengl environment using Need to pay attention to
The include order glew of #include is finite

At the same time in order to use the glew static library need to be defined in code GLEW_STATIC add glew32s. The use of lib Otherwise the glewInit @ link errors