Comments (5)
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.
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.
As the warning says function call with parameters that MAY be unsafe
.
You can ignore the warning in two ways:
- Add
#define _SCL_SECURE_NO_WARNINGS
into your code. - Right click on your project in the
Solution Explorer
. ClickProperties
. In the left hand tree clickC/C++
then go into thePreprocessor
pane. Click on thePrepprocessor 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.
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.
Fixed warnings by using checked iterators when _SECURE_SCL is set. Closing the issue.
from fmt.
Related Issues (20)
- std::chrono::current_zone() is not meant to return the local time zone HOT 4
- It would be good to have a customizable separator in fmt::group_digits(...) HOT 1
- fmt::styled and fmt::formatter<std::string> parse deactivate colors/termaps HOT 1
- formatting of variant types HOT 3
- FMT_USE_NONTYPE_TEMPLATE_ARGS detection is wrong on trunk HOT 2
- Support for a single `char` separator in `fmt::join()` HOT 1
- Formatting for strings with custom allocators fails to compile HOT 2
- Advice for extending libfmt for GPU support? HOT 2
- xchar.h extra dependencies HOT 1
- cannot use in CUDA (+MSVC) for newest branch master HOT 1
- Question: what's the difference between string-like formatters and where are they defined? HOT 2
- fmt won't let me specialize a formatter to format mixed character types. HOT 2
- `fmt::isnan` triggers floating-point exception for NaN values HOT 4
- Header-only mode not linking with fmt::ostream HOT 1
- g++-14 compilation error using named arguments inside a generic lambda HOT 2
- Add support for grouping numbers and '_', ',' separators HOT 1
- How do you forward fmt::format_string without explicitly indicating it in the interface? HOT 1
- Fail to build on Ubuntu-18.04 with g++-13.2 HOT 8
- format_as support in fmt/core.h HOT 1
- format_as but with iterator HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmt.