[Vortex] Linking Problem (SASL/TLS prebuilt binaries + VC2005)

Francis Brosnan Blázquez francis at aspl.es
Mon Feb 23 09:33:50 CET 2009

> Hi,


> I am now trying to change my code to use new 1.1 version of Vortex,
> but encountered some problems with TLS and SASL support. I get some
> unresolved symbols when linking against prebuilt libvortex-1.1.lib,
> libaxl.lib
> libvortex-tls-1.1.lib and libvortex-sasl-1.1.lib libraries.
> "error LNK2019: unresolved external symbol "int __cdecl
> vortex_sasl_accept_negotiation(struct _VortexCtx *,char const *)"
> (?vortex_sasl_accept_negotiation@@YAHPAU_VortexCtx@@PBD at Z) referenced
> in ..."
> Any ideas on that? Should I try to build the Vortex source myself?
> It's strange that the main vortex lib seems to be ok, though.

This is a C extern problem as pointed Sam. Vortex 1.0 symbols were protected 
by BEGIN_C_DECLS but this declaration was not moved to extension libraries  
(sasl, tls,...) causing VC link symbols as they were c++ functions. This is 
fixed in svn.

In the mean time you'll have to modify your vortex_sasl.h and vortex_tls.h to 
add manually these declarations as they figure in [1] and [2].

> Another problem I'm having is that the two callbacks for finding
> certificates and private key file locations do not have any user data
> field (axlPointer user_data) defined and this causes me trouble since
> I am using 'user_data' to store "this" pointer of a class for proper
> encapsulation (redirecting functions callbacks to methods). I have a
> Vortex context as a class member and thus need a this pointer to
> access it. This was not a problem earlier, since there were no concept
> of separate contexts before. I could kludge this by using a static
> variable, but would prefer doing it the right way (so I guess what I'm
> asking is that whether we could change the callback signature to
> contain user_data as a last parameter). What do you think?

You have several alternatives available. Maybe the more appropiate for your 
case is to use vortex_tls_set_ctx_creation to configure your 
VortexTlsCtxCreation. They will allow you to configure the self reference 
pointer. See vortex tls module documentation.

> To sum up what I have done so far in order to get Vortex 1.0 code to
> compile as 1.1 is:
> 1. Changed negociate in some function names to negotiate.
> 2. Changed initialization to use vortex context
> 3. Added context as a first parameter for all function calls.
> 4. Had to make a kludge to provide the correct context for certificate
> and private key file locations as no user_data is provided with the
> callbacks.
> 5. Added #include statements for vortex TLS and SASL headers.

Just to confirm this is now the procedure, that is, you have to include 
vortex.h and then all required extensions. In your case vortex_sasl.h and 

> 6. Changed to use Vortex 1.1 lib and aded 1.1 TLS and SASL libs as well
> 7. The code compiles now fine but get unresolved linker errors.

This will be fixed either by updating your local copy of vortex_sasl.h and 
vortex_tls.h or telling your compiler that symbols found on those files are C 


> Thanks in advance for any help,
> Juhani

Francis Brosnan Blázquez <francis at aspl.es>
Advanced Software Production Line, S.L.

More information about the Vortex mailing list