Static link of glfw3 library fails for me

Mike Parker aldacron at gmail.com
Sun Jul 26 10:41:27 UTC 2020


On Sunday, 26 July 2020 at 08:28:29 UTC, John Burton wrote:


> And I get the following errors from the link :-
>
> lld-link: error: undefined symbol: __GSHandlerCheck
> lld-link: error: undefined symbol: __security_check_cookie
> lld-link: error: undefined symbol: __security_cookie

I believe that's because the GLFW library was compiled with the 
Microsoft compiler's /GS option:

https://docs.microsoft.com/en-us/cpp/build/reference/gs-buffer-security-check?view=vs-2019

The __security_* functions are MS extensions to the C standard 
library. A quick search suggests you should try linking with 
bufferoverflowU.lib. Either that or compile GLFW with /GS- to 
turn off the security checks.

This is one reason I gave on on static linking pre-built C 
binaries long ago. I use the static bindings with import 
libraries, but I don't touch static libs unless I compile them 
myself.


More information about the Digitalmars-d-learn mailing list