Elmi
Elmi

Reputation: 6203

symbol lookup error: undefined symbol: _alloca

I'm building a shared object (.so) that internally makes use of a function _alloca() (defined in malloc.h). This .so compiles smoothly. But as soon as I call a function that makes use of _alloca(), my application crashes whith a console output

symbol lookup error: undefined symbol: _alloca

So: any idea against what library I have to link during build to get this external reference resolved?

Platform is CentOS7 x64

Thanks!

Upvotes: 1

Views: 1067

Answers (1)

user1350184
user1350184

Reputation:

_alloca is used by the Visual C++ compiler on Windows. You need to use alloca (without the underscore) for compiling on Linux.

Upvotes: 2

Related Questions