Yes, it works great now, thanks!
- Dominic
Rob Leslie wrote:
On Thursday, April 11, 2002, at 01:50 AM, Dominic Mazzoni wrote:
It's funny, I didn't notice id3_frame_new because I assumed that all of the functions I would need were in id3tag.h (since most of them were already there).
Hmm, this is an oversight. The prototype should have been put in id3tag.h.
Your ::ExportID3() looks good; try the following MakeID3Frame() instead:
Strange, I tried to add your functions and I'm getting linker errors with all of the functions I try to call which are not in id3tag.h. Does this make any sense? (It's possible it's my fault, but I did a make clean, I'm linking to libid3tag.a from mad-0.14.2b, and there were no compiler warnings...):
obj/Tags.o: In function `MakeID3Frame(char const *, char const *)': /home/dmazzoni/audacity/src/Tags.cpp:214: undefined reference to `id3_frame_new(char const *)' /home/dmazzoni/audacity/src/Tags.cpp:217: undefined reference to `id3_latin1_length(unsigned char const *)' /home/dmazzoni/audacity/src/Tags.cpp:219: undefined reference to `id3_latin1_decode(unsigned char const *, unsigned long *)' collect2: ld returned 1 exit status
Is it possible that these functions are not being exported?
Probably since they do not appear in id3tag.h, the prototype is being inferred from use, and since you're using C++ the compiler assumes they are C++ functions and does name mangling prior to linking.
I think you can work around this by explicitly adding some prototypes:
extern "C" { struct id3_frame *id3_frame_new(char const *); id3_length_t id3_latin1_length(id3_latin1_t const *); void id3_latin1_decode(id3_latin1_t const *, id3_ucs4_t *); }
Sorry about this. I'll have to update the library to put the prototypes in id3tag.h.
-- Rob Leslie rob@mars.org