[OpenIndiana-discuss] undefined symbol __gnu_cxx::__pool<true>::_M_reserve_block(unsigned int, unsigned int)

James Carlson carlsonj at workingcode.com
Mon Nov 4 20:27:45 UTC 2013


On 11/04/13 14:55, Apostolos Syropoulos wrote:
> Undefined                       first referenced
>  symbol                             in file
> avresample_close(AVAudioResampleContext*)     ../../../build/cBaseMediaFile.o
> avresample_free(AVAudioResampleContext**)     ../../../build/cBaseMediaFile.o
> avresample_convert(AVAudioResampleContext*, unsigned char**, int, int, unsigned char**, int, int) ../../../build/cBaseMediaFile.o
> avresample_get_delay(AVAudioResampleContext*)     ../../../build/cBaseMediaFile.o
> avresample_open(AVAudioResampleContext*)     ../../../build/cBaseMediaFile.o
> avresample_available(AVAudioResampleContext*)     ../../../build/cBaseMediaFile.o
> avresample_alloc_context()          ../../../build/cBaseMediaFile.o
> ld: fatal: symbol referencing errors. No output written to ../../../build/ffDiaporama
[...]
> $ elfdump /opt/gnu/lib/libavresample.so|grep avresample_close
>       [63]  0x0000e140 0x000000ac  FUNC GLOB  D    1 .text          avresample_close
>      [182]  0x0000e140 0x000000ac  FUNC GLOB  D    1 .text          avresample_close
>         54  [63]        avresample_close
>       [58]  0x000203c0  0x00003afe  R_386_JMP_SLOT            avresample_close
>   R_386_JMP_SLOT              0x203c0             .rel.plt       avresample_close

Is there any chance that libavresample.so was compiled as a C program
and cBaseMediaFile.o was compiled as C++?

It looks like it's just tripped up by name mangling.  Either
cBaseMediaFile.cpp should be doing something like this:

// Need to dip into the old world to accommodate avresample.
extern "C" {
#include "avresample.h"
}

or the avresample header files should do what almost everyone does these
days in C header files and wrap the contents so that they can be parsed
correctly by both C and C++ compilers:

/*
 * Need to provide proper symbol names in case this library is used by
 * C++.
 */
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif

-- 
James Carlson         42.703N 71.076W         <carlsonj at workingcode.com>



More information about the OpenIndiana-discuss mailing list