Glad: error C4996: 'strncpy' unsafe

Created on 13 Nov 2017  ·  8Comments  ·  Source: Dav1dde/glad

Hi!

Today I generated a glad.c file and includes for C++ and OpenGL 4.4 using your webservice.

When I tried to include it in my C++ Project (#include as well as adding the glad.c file to my project) and building that, I got the following two errors:

e:\files\opengl\glad.c(173): error C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

c:\program files (x86)\windows kits\10\include\10.0.16299.0\ucrt\string.h(343): note: see declaration of 'strncpy'

I tried reinstalling this exact windows kit but that didn't help.

Is there any way I can solve this problem? Or did i make a mistake when generating the files / integrating them into my project?

~ Incendor

bug

Most helpful comment

Should be fixed in master, can you confirm that for me?

Try generating glad from here: http://cglad.dav1d.de/ (note that is not yet live and a different subdomain).

Thanks!

All 8 comments

Thanks for bringing that up, that's a thing I should fix asap.

Since I don't want to rush you to create a fixed release, is there a simple way I can fix the generated glad.c file myself?

I also meet this bug,

Workaround is defining:

#define _CRT_SECURE_NO_WARNINGS

before including glad. I will release an updated version within a few hours.

Cool, thank you very much! I'll try later today. Sorry if asking for a workaround seemed stupid, I'm super new to C++ and just following a tutorial on OpenGL right now. Thank you for your amazing generator, quick support and help! :)

~ Incendor

Should be fixed in master, can you confirm that for me?

Try generating glad from here: http://cglad.dav1d.de/ (note that is not yet live and a different subdomain).

Thanks!

Worked great! :)

Now I'm getting a LINK error but I don't think that has to do with glad.

Thanks again, I finally managed to setup a project in VC++ - works also on my end :)

Changes pushed to the main website - Will push a new version after fixing the (void) bug in #119.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Develon5543 picture Develon5543  ·  8Comments

tombsar picture tombsar  ·  8Comments

NamelessPerson picture NamelessPerson  ·  3Comments

Frank-Walker picture Frank-Walker  ·  4Comments

tysonbrochu picture tysonbrochu  ·  7Comments