c4996 errors (warnings)

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
TheGates
Knows some wx things
Knows some wx things
Posts: 35
Joined: Tue Aug 10, 2021 6:24 pm

c4996 errors (warnings)

Post by TheGates »

hey,

why am I suddently getting 98 c4996 errors?
I know I can add _CRT_SECURE_NO_WARNINGS flag but can someone explain why this happens?
because I built my project before succesfully multiple times

mtk
Windows 10
Visual Studio (Visual C++)
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: c4996 errors (warnings)

Post by doublemax »

Did you update your Visual Studio version?
Use the source, Luke!
TheGates
Knows some wx things
Knows some wx things
Posts: 35
Joined: Tue Aug 10, 2021 6:24 pm

Re: c4996 errors (warnings)

Post by TheGates »

doublemax wrote: Sat Aug 28, 2021 8:46 pm Did you update your Visual Studio version?
It did not happen after an update no.
Windows 10
Visual Studio (Visual C++)
TheGates
Knows some wx things
Knows some wx things
Posts: 35
Joined: Tue Aug 10, 2021 6:24 pm

Re: c4996 errors (warnings)

Post by TheGates »

any of these imports are creating an error:

Code: Select all

#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/dataview.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/gbsizer.h>
#include <wx/frame.h>
Windows 10
Visual Studio (Visual C++)
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: c4996 errors (warnings)

Post by doublemax »

Something must have changed if you didn't get the warnings before.

Just to clarify: These warnings are all about CRT functions,right?
Use the source, Luke!
TheGates
Knows some wx things
Knows some wx things
Posts: 35
Joined: Tue Aug 10, 2021 6:24 pm

Re: c4996 errors (warnings)

Post by TheGates »

doublemax wrote: Sun Aug 29, 2021 12:01 am Just to clarify: These warnings are all about CRT functions,right?
I think I changed the ui a little using wxFormBuilder before it started happening.

Debug build x86 : 49 CRT function warnings
Debug build x64 : 49 CRT function warnings and 1 error saying:

Code: Select all

 __w64 can only be specified on int, long, and pointer types C:\wxWidgets-3.1.5\include\wx\types.h
I have a Frame and a FrameLayout. Frame inherits FrameLayout (FrameLayout is generated by wxFormBuilder)
When I remove inherit and remove import, build succeeds without warnings.
Do you need the error list?
Windows 10
Visual Studio (Visual C++)
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: c4996 errors (warnings)

Post by PB »

The warnings will always be there when an "unsafe" function is referenced. Just suppress the warnings in your project settings and be done with it.

IIRC, the __w64 "error" is not a build error but rather an IntelliSense one, its cause has been removed from the master just recently.
TheGates
Knows some wx things
Knows some wx things
Posts: 35
Joined: Tue Aug 10, 2021 6:24 pm

Re: c4996 errors (warnings)

Post by TheGates »

PB wrote: Mon Aug 30, 2021 7:56 am The warnings will always be there when an "unsafe" function is referenced. Just suppress the warnings in your project settings and be done with it.

IIRC, the __w64 "error" is not a build error but rather an IntelliSense one, its cause has been removed from the master just recently.
okay, thanks. I was asking because you shouldn't want "unsafe" things in your release.
Windows 10
Visual Studio (Visual C++)
Post Reply