opencv2 flann logger.h uses fopen instead of fopen_s (Bug #3388)


Added by Goncalo Lopes over 11 years ago. Updated over 11 years ago.


Status:Done Start date:2013-11-20
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:core
Target version:-
Affected version:2.4.7 (latest release) Operating System:Windows
Difficulty: HW Platform:Any
Pull request:

Description

The use of fopen is deprecated on windows and causes a compilation error by default on VS 2012 (error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.)

It would be nice to be able to compile and use OpenCV on Windows without having to set additional precompiler directives.

Steps to reproduce:
In Visual Studio 2012 create a C++ project and make sure you add #include <opencv\cv.h>.
Build the project.


Associated revisions

Revision c4906c7f
Added by Vadim Pisarevsky over 10 years ago

Merge pull request #3388 from bartaandras:master

History

Updated by Sergei Nosov over 11 years ago

Hi!

#include <opencv\cv.h> header has been kind of deprecated. You should be using #include <opencv2/opencv.hpp> instead. Also, it would be a good practice to use more specific headers, like #include <opencv/core/core.hpp>.

Does it fix the warnings?

  • Status changed from New to Incomplete

Updated by Sergei Nosov over 11 years ago

  • Category set to core

Updated by Goncalo Lopes over 11 years ago

Thanks. Indeed, the right includes seem to fix the issue.

  • Status changed from Incomplete to Done

Also available in: Atom PDF