Tag Archives: vs2015

[Solved] unesolved external symbol _imp_fprintf referenced in funciton _showerror

There are two problems when debugging projects written in ffmpeg with vs2015:

Question 1:

“LNK2019 unresolved external symbol __imp____iob_func reference in function _ShowError”

Solution: add this sentence to the source code: extern “C” {file _iob_func [3] = {* stdin, * stdout, * stderr};}

Question 2:

“unesolved external symbol _imp_fprintf referenced in funciton _showerror”

Solution: right-click the item — properties — configuration — linker — input — additional dependencies to add the library legacy_stdio_definitions.lib

Error 3 error C2065: ‘endl‘ : undeclared identifier-Error 2 error C2065: ‘cout‘ : undeclared identif

As you can see, I just want to print something, and iostream is added, but that means I cout can’t use it.

hold   If StdAfx. H is placed at the front of the whole file, no error will be reported

In fact, if other header files are mentioned to the front, an error will be reported – this may be the provision of VS2010,   StdAfx. H must be first.

 

Even if you comment it out   All include in StdAfx. H are commented out. Whether the compilation passes or not.

 

 

[Solved] Vs2015 error c2065: undeclared identifier error (__func__)

Problem: vs2015 compiles vtk8.2 with an error    Error c2065 undeclared identifier error (__ func__)

Solution: (two)

(1) Change the header file sequence online (the first method is tested, but it doesn’t work. It’s here temporarily, and the second method is effective)

#include "StdAfx.h"

Put it first

(2) Change,, name (test valid)

__func__ replace to __FUNCTION__

Test valid

#During OpenGL development, fatal error C1083: can’t open include file: “GL / glut. H”: no such file or directory

During OpenGL development, fatal error C1083: can’t open include file: “GL/glut. H”: no such file or directory

I use vs2012 to write a simple OpenGL program, which always prompts when running:

Fatal error C1083: unable to open include file: “GL/glut. H”: no such file or directory;

Or fatal error C1083: cannot open include file: “GL/glaux. H”: no such file or directory;

At this time, the corresponding operations are as follows:

1. Download glut Toolkit: glut_ 37beta. Rar
2. Untie the downloaded compressed package and you will get five files, including glu32. Lib; glut32.dll,glut32.lib; Glut.dll, glut. H, glut. Lib
3. Put the extracted glut. H and glux. H in the folder C: program files (x86) and windows kits (8.0) and include (UM)( Note: the directory where each person installs vs is different, and the operation is based on the actual situation)
4. Put the extracted glut.lib, glut32.lib and glaux.lib in the static function library, which is located in the folder C: program files (x86) – Windows kits (8.0) – lib (win8) – um (x86)
5. If it still can’t work, put glut32.dll back to C: Windows/syswow64
6. Compile again. If there is still an error, change the original name of the header file # include & lt; GL/glut.h> Include & lt; glut.h>。
///

Download address of glut in Windows Environment: (about 150k in size)

http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip

This is the first article I saw when I configured the environment. Later, I made a mistake and used the method of this article to solve the problem https://www.pianshen.com/article/78231370291/

The cxx compiler identification is unknown

//Configure VS2015/VS2015/VS2015/VS2015/VS2015/VS2015/VS2015

The CXX compiler identification is unknown

Cmake can’t find the C++ compiler. Check the VS installation directory for cl.exe, rc.exe and rcdll. DLL.
If you do not have cl.exe, you may have only installed VS and no VC compiler. Open VS and select VC to install.
If you do not have rc.exe and rcdll. DLL, which are used for compiling resources, you may install them in the Windows SDK. You can directly copy these two files to the VC/bin directory.

Configure OpenGL development environment (vs2015)

Configuring the OpenGL development environment (VS2015)
There are a lot of configuration VS + OpenGL tutorials online, for the configuration of the super treasure of the good and bad are mixed, mainly the official website did not give a good compiled library, many need to compile their own, so for beginners, it is difficult to configure successfully.
 
The following is a blog post that explains the configuration process and the rationale behind it
http://www.it165.net/pro/html/201504/38164.html
 
For beginners, everyone wants to be able to run the example given in the super bible. Here I directly give several twists and turns, all kinds of files generated after compilation, according to the following configuration can be run in VS2015 super treasure in the example, to achieve development.
 
I. Required allocation of resources

Resource download: http://download.csdn.net/download/ax_hacker/10107105
The zip package contains two folders, CJBD5_CODE and OpenGL. The former contains the sample program, and the latter is the three files required for configuration.
 
Include
Lib
Dll
 

How do I configure the development environment, as I explained in a previous blog post
http://blog.csdn.net/ax_hacker/article/details/78140003
The following is the configuration process for OpenGL.
 
1, Copy the files in the DLL folder to C:\Windows\ Syswow64 and C:\Windows\System32
 
2. Create an empty project, add a source file, and configure the project properties
 
1) Put the include from the previous folder under the include directory

 
2) lib in the library directory

 
3) Linker ->; Input – & gt; Additional dependencies freeglutd.lib; GLTools.lib; freeglut.lib; glew32s.lib

The simplest way to configure OpenGL development environment with vs2015

This method I think is the simplest!
Before I wrote this, I did a lot of research online on what to do with GLUT, GLEW, FreeGLUT, and what files to add to the site. Now I can tell you that VS2015 is so powerful that none of these operations are needed! VS has a tool called NuGet, which is a package manager for.NET. NuGet allows developers to create, share, and use libraries. We use OpenGL, which should be called libraries using OpenGL.
VS2015 steps to configure OpenGL. First, you need to have a project, and then add the OpenGL library to your project by clicking Project ->; Manage NuGet package, and then in a TAB, click on the “browse” input “NupenGL” into the search box, search will appear two libraries, we should both to our engineering to installation, after the success of the installation, you can find them in the installed base, in the right of the child window, you can learn about the installation of the library information.



It is not particularly easy to install GLUT, FreeGLUT, and GLEW libraries in just a few simple steps.
>
>
>
>
>
>
> I won’t post the source code.

You look at the picture below, is it time to put your heart at ease?

But again simple things, some people will still appear all kinds of problems. First of all, every time you create a new OpenGL project, you have to install a library. Some people hate this tedious, but I can’t help it. It won’t take you half a minute to install these two libraries, and you don’t have to do that on other computers. Also, turn off the 360, it’s so annoying!

Vs2015 configuring OpenGL (glfw Library)

Recently to use OpenGL, in VS2015 configuration cost a lot of effort, now will be my results directly contribute to everyone, hope to need to configure OpenGL under VS2015 readers save some trouble.
Documents to prepare
Baidu cloud link: https://pan.baidu.com/s/1qZbcLtU password: f58o
PS: The tutorial gives you a 32-bit library. Baidu Cloud Resource is the 64-bit runtime I compiled later. The configuration process is similar to
Download the relevant header files

Download or compile the relevant library files
Here I used the library files compiled by Win32, that is, the Release of x86 platform, including the lib static library and the dynamic DLL library;

File storage
Put all the header and library files in one folder (I put them in the D:/freeglutlib folder);

Part program
1. Open VS2015, create a new Win32 console program, set the compilation environment as x86 or Win32, Release version;

2. Find the property manager and create a new property sheet under the corresponding compilation environment;

3. Select the VC++ directory ->; Include directory, library directory, just saved the header file and library file corresponding folder to add in


4, Compiler ->; Input – & gt; Attach a dependency, and type the DLL names of all the external libraries used

5. Add code in main file to test

DirectX encountered “unresolved external symbol” when compiling on vs2015__ The solution and reason of “vsnwprintf”

Note: The following error was encountered while compiling DirectX provided sample on VS2015

LNK2001 __vsnwprintf SimpleSample11 C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\Direct3D11\SimpleSample11\ DxErr. Lib (dxErr.obj)

Some of the information found on the Internet is summarized as follows
The solution
Add the following compile preprocessor instruction to the source file that reported the error

#pragma comment(lib, "legacy_stdio_definitions.lib")

Error reason
The VS2015 design changed many of the original libraries to inline, and inline functions are not visible to DLLs or LIBs, so there is no library file to link to, so we have to add a special library file to link to the library functions, namely legacy_stdio_defines.lib. There are many Windows 8 SDKs that rely on these methods that have been inlined in the new runtime, and so far it seems that using legacy_stdio_defines.lib can remedy most of the problems left over from this change. According to Microsoft, they will update the Windows SDK in the final VS2015 release to resolve this issue.
Refer to the address

    (VS 2015 CTP 5 C++) _vsnwprintf_s and other functions are not exported in appcrt140.dll, breaking linkage of static libraries C++: Unresolved external symbol _sprintf and _sscanf in Visual Studio 2015missing (stdio) identifiers with external linkage

Environment configuration at the beginning of OpenCV + vs2015

    First of all, the configuration of the system environment (after the computer has configured OpenCV once, there is no need to reconfigure). After the configuration of the system environment variables, the corresponding configuration is carried out on VS2015. First select the new project — VC++ — Win32 console program — empty project, and then right-click the source file to create a corresponding main function;

Then find the property manager in the view – Microsoft.cpp.x64.user in the Debugx64, and right-click to select the property; Add and edit the include file in the VC++ directory:
E:\opencv\opencv\build\include\opencv2
E:\opencv\opencv\build\include\opencv
E:\opencv\opencv\build\include
To add and edit the library directory:
E:\opencv\opencv\build\x64\vc15\lib
Add and edit the — input — attached dependencies in the linker:
Opencv_world341d. Lib
After the above three steps, click Apply and all the variables are configured. At this point, you can choose a simple program to run (e.g., display an image).
# include & lt; opencv2/opencv.hpp>
# include & lt; iostream>
Using the namespace CV;
Using namespace STD.
 
Int main(int argc, char** argv)
{
cout < < “Hello World” & lt; < Endl;
Mat image = imread (” E: \ \ v \ \ c + + \ \ hello word2 \ \ hello word2 \ \ 10. JPG “);
// NamedWindow (” test image “);
Imshow (” ceshi “, image);
/*if (image.empty())
{
imshow(“window”, image);
} * /
waitKey(0);
Return 0;
}
In particular, it is necessary to pay attention to:
1. Be sure to configure it on the solution configuration and solution platform. Debug+x64
2. The images that need to be opened must be placed in the same path as the.cpp file
The escape character in the path is uble slash.
Can consult to solve video https://v.qq.com/x/page/d0519qgy4lu.html?

OpenGL environment configuration under VS2010 / vs2012 / vs2015

Please read every word carefully.  
In order to learn “OpenGL Super Bibliography (Fifth Edition)” must configure OpenGL environment, is the so-called work to do its thing must first benefit its device. Through a lot of online configuration tutorial, have a lot of problems, but also has the essence of the detailed tutorial, such as a blog: http://www.zyh1690.org/build-opengl-super-bible-fifth-edition-development-environment/. While the tutorial is detailed, there are a few details that the blog doesn’t go into. Configuring the OpenGL environment must be careful and patient. Because a little oversight can cause the final configuration environment to fail. Although this is for the “Win7 X64 +VS2010” environment configuration process, but I in VS2012/VS2015 also built successfully, VS2012/VS2015 configuration OpenGL principle is also very simple, is one of the Microsoft Visual Studio 10.0 to add files into Microsoft Visual Studio 12.0 or Microsoft Visual Studio 15.0 to add related files.
Configure environment:
win7 X64 + Visua Studio 2010
win7 X64 + Visua Studio 2012
win7 X64 + Visua Studio 2015
Required configuration files and tools:

Baidu cloud disk Download Address:
Link: http://pan.baidu.com/s/1kVsKUGJ password: XXQQ
Link: http://pan.baidu.com/s/1slu9RK5 password: asj8
Here is the official setup:>; > > > > > > > > > > > > > > > > > > > > > > > Line & gt; > > > > > > > > > > > > > > > > > > > > > > > > Line & gt; > > > > > > > > > > > > > > > > > > > > > > > >

The FreeGLUT configuration

Open the x:\x\ FreeGlut-2.8.1 \VisualStudio\2010\ FreeGlut.SLN project project, (if you are configuring VS2015, you can select x:\x\…. \2015\ FreeGlut.SLN Project Project)

The solution is generated in Debug mode and Release mode, respectively. (You can generate only one. It is recommended to compile in debug mode without execution. If you run the pop-up black box, ignore it. 32-bit operating systems note that eventually, when running the code in Bluebook chapter01\ Block, if you encounter a problem with freeglut_static. Lib not being opened, you should choose Debug_Static mode to recompile and generate the required freeglut_static. Lib and add it to the specified folder.)
You will see the generated.dll and.lib files in the x:\x\ FreeGlut-2.8.1 \lib\x86 directory. Please add _d to the.dll and.lib files in the Debug directory to distinguish them later. As shown in figure:

 
X :\x\ FreeGlut-2.8.1 \ Include \GL: :\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ Include \GL: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Copy the.dll file in the x:\x\ FreeGlut-2.8.1 \ Lib \x86 folder (and the Debug folder) to the C:\ Windows&syswow64 directory (x86 to the System32 directory).
Copy the.lib file in the x:\x\ FreeGlut-2.8.1 \lib\x86 folder (and the Debug folder) to x:\x\Microsoft Visual Studio 10.0\VC\lib.
So now the FreeGlut is done!
(Once you’ve done this, you can code check.
Test 1: build Win32 console project, add test code, compile and run.
Test two: build Win32 console project, add test code, compile and run.

II. GLEW configuration
Copy the.h file in the folder x:\x\glew-1.11.0\include\GL to the directory x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\GL.
Copy the.lib file in the folder x:\x\glew-1.11.0\lib\Release\Win32 to the directory x:\x\Microsoft Visual Studio 10.0\VC\lib.
Copy the.dll file from the x:\x\glew-1.11.0\bin\Release\Win32 folder to the C:\ WindowsSYSWOW64 directory. (If not, skip it.)
(Note that if VS2015 is supplied, you need to put the configuration file in x:\x\Microsoft Visual Studio 15.0…. C)

Third, GLUT configuration
Copy the.h file in the folder x:\x\ Glutdlls37Beta to the directory x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\GL.
Copy the.lib file under the x:\x\ Glutdlls37Beta folder to the x:\x\Microsoft Visual Studio 10.0\VC\lib directory.
Copy the.dll file under the x:\x\ Glutdlls37Beta folder to the C:\ WindowsSYSWOW64 directory.
(Note that if VS2015 is supplied, you need to put the configuration file in x:\x\Microsoft Visual Studio 15.0…. )
4. Build GLTools library
Create a new GLTools Win32 project, as shown in the figure below:

 

First compile, (original here has error, below is I modify)
Copy the.cpp file (excluding glew.c file) in the x:\x\SB5\Src\GLTools\ Src directory to x:\x\ GLTools\ GLTools.
Copy the.h file (excluding the GL folder) in the x:\x\SB5\Src\GLTools\include directory to x:\x\ GLTools\ GLTools.
Right-click on the header file and the source file respectively and add ->; The existing item adds.h and.cpp files to the project. As shown in figure:

 
The compiler prompts are as follows:

The gltools.lib file was generated successfully. It can be viewed under the x:\x\gltools\Debug directory.
Copy the.lib file to the x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib folder.
Copy the.h file to the x:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include folder (note that this is not the GL folder).
So gltools is OK.

Five, the test
Let’s test the environment using the examples given in the book. If the test is successful, then the OpenGL environment is ready.
The project of establishing TEST:


We use the example from Chapter 1 to test by copying all the files in the x:\x\SB5\Src\Chapter01\Block into the x:\x\test\test folder. Also right-click on the source file and add ->; The existing entries include the block.cpp file.
Adding Additional Dependencies (first figure) :(This way of adding dependencies only works for the current Test project. To make these.lib files available to other projects, you should add dependencies to the properties manager, as shown in the second figure below.


Compile and run the project, and the effect is as follows :(If there is an error in compilation, search the error information with Baidu Browser to find the corresponding solution. Or check out “Some special cases handling” at the end of this blog post for help.)
Press the space bar to transform the display effect, a total of six effects:






VI. Handling of some special cases:
Configuring the OpenGL environment exactly as described above will work on most computers. However, there are always exceptions. If the configuration fails, the following configuration details may help you solve the problem.
Case1: freeglut_static.lib could not open the problem
OpenGL SuperBibliography \SB5\SB5\ FreeGlut-2.6.0 \VisualStudio2008Static\Release FreeGlut_Static. Lib to X :\Program Files (x86)\Microsoft VisualStudio 10.0\VC\ Lib If you fail, try Plan 2.
Solution 2: Take a closer look at the FreeGLUT configuration section of this blog post, which is highlighted in bold red. Pay attention to configuration details.
case2: “math3d.h” : No such file or directory
C :\project\gltools\gltools\math3d.cpp(45): fatal error C1083: failed to open the “math3d.h” : No such file or directory header file.
Case3: UCrtBased. DLL missing
in Visual Studio 2015
Can follow this link: http://blog.csdn.net/so_geili/article/details/53009680, choose the “solution” to solve the problem.

Solve the problem that the header file of “graphics. H” cannot be loaded in vs2015

PS: For all versions of VS, you just need to download the corresponding lib and include folders. The operation method is the same
First need from this baidu disk address link: click the link, password for wi9b password: wi9b
Then download the following two files:
After downloading, open the downloaded folder Inlcude, copy the two files inside, and then paste into

In the folder shown in the above image, continue to open the downloaded lib2015 folder, select all the contents, copy and paste into

As shown in the above picture, since my VS2015 is on the D disk, these two folders are under the VS folder under the VS2015 directory you installed.
Then we can run the “graphics.h” header file in VS2015, which contains rich drawing functions!!