segfault when functions are defined in headers or inlined

Ángel González
Fri Jul 10 14:32:00 GMT 2015

On 10/07/15 13:21, achkan wrote:
> When is said every function I meant every function from the library (which
> uses a lot of stuff... Torch7, wxWidget, opengl, eigen, opencv...). I
> wouldn't know how to reproduce its behavior. But I'm sure that this problem
> happens only when I include the wxWidget headers (the console versions do
> not segfault.). Is it possible for a library to cause the problem I'm
> talking about? I mean how can
> leaky code, or any memory problems be avoided just by moving the definition
> to the cpp?? But yeah you're right. I'll see if I can do that.

Are you using an already-built library file?
A mismatch between the library object and the headers you use could cause
what you are seeing. I would try recompiling the library.

More information about the Gcc-help mailing list