[openssl-users] OpenSSL 1.0.2.f undefined reference: _Stoul

Craig_Weeks at trendmicro.com Craig_Weeks at trendmicro.com
Tue Oct 18 20:05:07 UTC 2016

Ok, I see *how* this is happening, but I don't understand why.  In the version of stdlib.h that I am including I see:

#if defined(__cplusplus) && !defined(_NO_CPP_INLINES)
#else /* defined(__cplusplus) && !defined(_NO_CPP_INLINES) */
typedef int _Cmpfun(const void *, const void *);

int atexit(void (*)(void));
void * bsearch(const void *, const void *, size_t, size_t, _Cmpfun *);
void qsort(void *, size_t, size_t, _Cmpfun *);

double atof(const char *);
int atoi(const char *);
long atol(const char *);
double strtod(const char *_Restrict, char **_Restrict);
unsigned long strtoul(const char *_Restrict, char **_Restrict, int);

#define atof(str)	_Stod(str, 0, 0)
#define atoi(str)	(int)_Stoul(str, 0, 10)
#define atol(str)	(long)_Stoul(str, 0, 10)
#define strtod(str, endptr)	_Stod(str, endptr, 0)
#define strtoul(str, endptr, base)	_Stoul(str, endptr, base)

So, for C code this header maps strtoul() (see parse_tagging() in crypto/asn1/asn1_gen.c for an example) to _Stroul().  That is definitely "helping" me more than I want but I don't know how to make it stop.

-----Original Message-----
From: openssl-users [mailto:openssl-users-bounces at openssl.org] On Behalf Of Salz, Rich
Sent: Friday, October 14, 2016 4:21 PM
To: openssl-users at openssl.org
Subject: Re: [openssl-users] OpenSSL 1.0.2.f undefined reference: _Stoul

Stoul is usually a C++ function.  Are you sure you're using the right compiler?  Add -lm to your link libraries?

That's all I've got.

Senior Architect, Akamai Technologies
Member, OpenSSL Dev Team
IM: richsalz at jabber.at Twitter: RichSalz

openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
<table class="TM_EMAIL_NOTICE"><tr><td><pre>
The information contained in this email and any attachments is confidential 
and may be subject to copyright or other intellectual property protection. 
If you are not the intended recipient, you are not authorized to use or 
disclose this information, and we request that you notify us by reply mail or
telephone and delete the original message from your mail system.

More information about the openssl-users mailing list