Code Monkey home page Code Monkey logo

Comments (5)

justnom avatar justnom commented on May 18, 2024

Not quite sure what errors you are getting - but you can just do what the article says and put

#define NOMINMAX 

after your windows.h include.

from fmt.

cybaman avatar cybaman commented on May 18, 2024

Thank you it worked, but have some warnings now.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2239): warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2224) : see declaration of 'std::_Copy_impl'
2> M:\mmgit\mmcyb\inc\format.h(106) : see reference to function template instantiation '_OutIt std::copy<T*,T*>(_InIt,_InIt,_OutIt)' being compiled
2> with
2> [
2> _OutIt=char _,
2> T=char,
2> _InIt=char *
2> ]
2> M:\mmgit\mmcyb\inc\format.h(103) : while compiling class template member function 'void fmt::internal::Array<T,SIZE>::Grow(size_t)'
2> with
2> [
2> T=char,
2> SIZE=500
2> ]
2> M:\mmgit\mmcyb\inc\format.h(423) : see reference to class template instantiation 'fmt::internal::Array<T,SIZE>' being compiled
2> with
2> [
2> T=char,
2> SIZE=500
2> ]
2> M:\mmgit\mmcyb\inc\format.h(870) : see reference to class template instantiation 'fmt::BasicWriter' being compiled
2> with
2> [
2> Char=char
2> ]
2> M:\mmgit\mmcyb\inc\format.h(1126) : see reference to class template instantiation 'fmt::BasicFormatter' being compiled
2> with
2> [
2> Char=char
2> ]
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2239): warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2224) : see declaration of 'std::Copy_impl'
2> M:\mmgit\mmcyb\inc\format.h(106) : see reference to function template instantiation 'OutIt std::copy<T,T
>(_InIt,_InIt,_OutIt)' being compiled
2> with
2> [
2> OutIt=const fmt::BasicFormatter::Arg *,
2> T=const fmt::BasicFormatter::Arg _,
2> InIt=const fmt::BasicFormatter::Arg *
2> ]
2> M:\mmgit\mmcyb\inc\format.h(103) : while compiling class template member function 'void fmt::internal::Array<T,SIZE>::Grow(size_t)'
2> with
2> [
2> T=const fmt::BasicFormatter::Arg _,
2> SIZE=10
2> ]
2> M:\mmgit\mmcyb\inc\format.h(977) : see reference to class template instantiation 'fmt::internal::Array<T,SIZE>' being compiled
2> with
2> [
2> T=const fmt::BasicFormatter::Arg ,
2> SIZE=10
2> ]
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2813): warning C4996: 'std::_Fill_n': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2799) : see declaration of 'std::Fill_n'
2> M:\mmgit\mmcyb\inc\format.h(1508) : see reference to function template instantiation 'void std::fill_n<char
,unsigned int,char>(_OutIt,_Diff,const _Ty &)' being compiled
2> with
2> [
2> _OutIt=char _,
2> _Diff=unsigned int,
2> _Ty=char
2> ]
2> M:\mmgit\mmcyb\inc\format.h(1326) : while compiling class template member function 'void fmt::BasicFormatter::DoFormat(void)'
2> with
2> [
2> Char=char
2> ]
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2239): warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2224) : see declaration of 'std::_Copy_impl'
2> M:\mmgit\mmcyb\inc\format.h(117) : see reference to function template instantiation 'OutIt std::copy<const T,T
>(_InIt,_InIt,_OutIt)' being compiled
2> with
2> [
2> _OutIt=char *,
2> T=char,
2> _InIt=const char *
2> ]
2> M:\mmgit\mmcyb\inc\format.h(113) : while compiling class template member function 'void fmt::internal::Array<T,SIZE>::append(const T *,const T *)'
2> with
2> [
2> T=char,
2> SIZE=500
2> ]
2>Link:
2> test_strings.vcxproj -> D:\cybadev\Test\test_strings\Win32\Debug\test_strings.exe
2>FinalizeBuildStatus:
2> Deleting file "Debug\test_strings.unsuccessfulbuild".
2> Touching "Debug\test_strings.lastbuildstate".
2>
2>Build succeeded.

from fmt.

justnom avatar justnom commented on May 18, 2024

As the warning says function call with parameters that MAY be unsafe.
You can ignore the warning in two ways:

  1. Add #define _SCL_SECURE_NO_WARNINGS into your code.
  2. Right click on your project in the Solution Explorer. Click Properties. In the left hand tree click C/C++ then go into the Preprocessor pane. Click on the Prepprocessor Definitions and add the definition _SCL_SECURE_NO_WARNINGS. Remember to also do this to all your configurations.

Both of the above solutions achieve the same goal.

from fmt.

vitaut avatar vitaut commented on May 18, 2024

Fixed the compilation issue when windows.h is included in 6da2c53

I'll think what to do with the warnings, for now you can disable them as suggested by justnom.

Thanks.

from fmt.

vitaut avatar vitaut commented on May 18, 2024

Fixed warnings by using checked iterators when _SECURE_SCL is set. Closing the issue.

from fmt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.