[swift-users] C-function not found by linker

Rien Rien at Balancingrock.nl
Wed Jan 11 03:40:38 CST 2017


Sometimes you just have to post a stupid question to see what you did wrong :-(

So please disregard….


PS: it was of course the “static” (I have no clue why I did put that in there… oh well)

Regards,
Rien

Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: http://github.com/Swiftrien
Project: http://swiftfire.nl




> On 11 Jan 2017, at 10:28, Rien via swift-users <swift-users at swift.org> wrote:
> 
> My project uses openSSL and that works fine.
> 
> I needed one specific function that cannot be accessed from Swift directly, so I created a C-file for that. (both .h and .c file)
> 
> The function is found during compilation.
> 
> But is then reported as “unused” and the linker reports “missing function”.
> 
> Any idea’s how this can be caused?
> 
> More info:
> 
> The .h file:
> 
> static void sslCtxSetTlsExtServernameCallback(SSL_CTX *ctx, int (*cb)(SSL *, int *, void *), void *arg);
> 
> The .c file:
> 
> static void sslCtxSetTlsExtServernameCallback(SSL_CTX *ctx, int (*cb)(SSL *, int *, void *), void *arg) {
>    SSL_CTX_set_tlsext_servername_arg(ctx, arg);
>    SSL_CTX_set_tlsext_servername_callback(ctx, cb);
> }
> 
> Regards,
> Rien
> 
> Site: http://balancingrock.nl
> Blog: http://swiftrien.blogspot.com
> Github: http://github.com/Swiftrien
> Project: http://swiftfire.nl
> 
> 
> 
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users



More information about the swift-users mailing list