I'm stumped. Here is the output of ld.
/usr/lib/libvisual-0.6/actor/actor_avs_superscope.so: undefined reference to `visual_mem_free'
/usr/lib/libvisual-0.6/actor/actor_avs_superscope.so: undefined reference to `visual_mem_malloc0'
Here are the macros:
#define visual_mem_new0(struct_type, n_structs) \
((struct_type *) visual_mem_malloc0 (((visual_size_t) sizeof (struct_type)) * ((visual_size_t) (n_structs))))
#define visual_mem_malloc(size) \
visual_mem_malloc_impl (size, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define visual_mem_malloc0(size) \
visual_mem_malloc0_impl (size, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define visual_mem_realloc(ptr, size) \
visual_mem_realloc_impl (ptr, size, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define visual_mem_free(ptr) \
visual_mem_free_impl (ptr, __FILE__, __LINE__, __PRETTY_FUNCTION__)
Now it doesn't add up. One line's saying that visual_mem_free is missing, which is a macro. The other's saying that visual_mem_malloc0 is missing, but the code's actually calling visual_mem_new0, which suggests it sees visual_mem_new0.
priv = visual_mem_new0 (SuperScopePrivate, 1);
visual_mem_free (priv);
Any clues?
Edit: Bumping.. Maybe some fresh eyes can help?
Edit: By the way, I get no warnings/errors during compiling, nor linking.
Edit: Here's a couple of snippets from the preprocessor's output.
int lv_superscope_cleanup (VisPluginData *plugin)
{
SuperScopePrivate *priv = visual_object_get_private ((((VisObject*) ((plugin)))));
visual_mem_free_impl (priv, "actor_avs_superscope.c", 195, __PRETTY_FUNCTION__);
return 0;
}
And:
priv = ((SuperScopePrivate *) visual_mem_malloc0_impl (((visual_size_t) sizeof (SuperScopePrivate)) * ((visual_size_t) (1)), "actor_avs_superscope.c", 152, __PRETTY_FUNCTION__));
It looks like the macros are being expanded. I'm confused. Is __PRETTY_FUNCTION__
supposed to be expanded?
Interestingly enough, here's the output from strings.
$ strings .libs/actor_avs_superscope.so |grep malloc
visual_mem_malloc0_impl
visual_mem_malloc0
malloc
Chris: I'm just running ld /usr/lib/libvisual-0.6/actor/actor_avs_superscope.so
.
And here's the output from nm:
$ nm actor_avs_superscope.o |grep malloc
U visual_mem_malloc0_impl
$ nm actor_avs_superscope.o |grep free
U visual_mem_free_impl
U visual_palette_free_colors