Getting an Error while using OpenGL and Visual C++ 2008 Express Edition
Hi Friends,
I am using OpenGL and Visual C++ 2008 Express Edition as our IDE while currently working with our project. I am getting one error and 10 warnings when I am trying to build the project. The Error "C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(256) : see declaration of 'fscanf'
.\walker\walk\walker.cpp(270) : warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details." is coming for many times. Does anyone know how to resolve this error.?? Please help me as soon as possible.!!:notworthy
Re: How to disabling deprecation in VC++ Express Edition?
According to me by disabling deprecation in VC++ Express Edition, your problem should be solved. You can do the following settings for disabling deprecation in VC++ Express Edition :
- Go to the Project Properties
- Then click on the Configuration.
- Project properties->Properties->C/C++->Preprocessor->Preprocessor Definitions
- Click on the elipses (...)
type any definitions you like separated by "\n"ie
_CRT_SECURE_NO_WARNINGS
Re: Getting an Error while using OpenGL and Visual C++ 2008 Express Edition
In C++, the easiest way to do that is to use Secure Template Overloads, which in many cases will eliminate deprecation warnings by replacing calls to deprecated functions with calls to the new secure versions of those functions. There are several ways to eliminate deprecation warnings for the older, less secure functions. The simplest is simply to define _CRT_SECURE_NO_WARNINGS or use the warning pragma. Either will disable deprecation warnings, but of course the security issues that caused the warnings still exist. consider this deprecated call to strcpy in C++ :
char szBuf[10];
strcpy(szBuf, "test"); // warning: deprecated
Re: Getting an Error while using OpenGL and Visual C++ 2008 Express Edition
I was facing the similar problem. While linking I was getting the fatal error LNK1104: cannot open file 'glut32.lib'. Hope that you should also got this error which you have not posted. You can check this error by going to the BuildLog.htm which would be saved at the "file://g:\Interface - Copy\Interface - Copy\Interface\Debug\BuildLog.htm". The error of cannot open file 'glut32.lib', means that glut32.lib is not in the library path for your project. You will need to set your project to look for library files wherever you extracted Glut at.You can do this via: Tools->Options->Projects and Solutions->VC++ Directories->Show Directories for Library Files and add the path there. Hope that doing this will resolve your problem too.
Re: Getting an Error while using OpenGL and Visual C++ 2008 Express Edition
Even I think that you have not included the glut32.lib in the library path for your project. 'Modifier' already told you the one way for including the glut32.lib in the library path of your project. If that is not working then you can try the another way, you can follow the steps to add the path to Glut into your project's settings. Go to the Properties by right clicking on your project in the solution explorer. Then select the Configuration Properties. In the Configuration Properties, select the Linker option. In that select the General tab and fill in the path in the "Additional Library Directories". Doing this will also resolve your problem.