MediaArea / MediaInfoLib

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://mediaarea.net/MediaInfo
BSD 2-Clause "Simplified" License
634 stars 173 forks source link

brew install mediainfo / xcode Undefined symbol #1204

Open zn123 opened 4 years ago

zn123 commented 4 years ago

main.cpp

 MediaInfo MI;
    MI.Open("/Users/wangxueyan/video/46.mp4");
    while (true)
    {
        std::string str = MI.Get(stream_t::Stream_Audio, 0, i++, Info_Name);
        if (str == "")
        {
            break;
        }
        std::string str2 = MI.Get(stream_t::Stream_Audio, 0, str).c_str();
        parameter += "\r\n" + tempstr + ":"+str;
    }
    std::cout << parameter << std::endl;

Link Binary With Libraries +libmediainfo.a +libzen.a

*_*

Showing Recent Messages
:-1: Undefined symbol: MediaInfoLib::MediaInfo::Get(MediaInfoLib::stream_t, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, MediaInfoLib::info_t, MediaInfoLib::info_t)

Showing Recent Messages
:-1: Undefined symbol: MediaInfoLib::MediaInfo::Open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
g-maxime commented 4 years ago

Unable to reproduce with both Xcode 10.3 and 11.3

Can you share the complete project workspace ?

JeromeMartinez commented 4 years ago

Our builds is with Unicode. If you include MediaInfo.h instead of MediaInfoDLL.h,, there is no non-Unicode support (this is something we need to change in the future). We don't have the includes, so difficult to know the exact source of the issue. You may try to include MediaInfoDLL.h instead of MediaInfo.h or add #define _UNICODE before including MediaInfo.h (and adapt your source code accordingly).