[英]Adding ogg vorbis encoding to my project
對於我的MFC應用程序,我需要將數組中的.wav數據轉換為ogg vorbis格式。
我將libogg和libvorbis都編譯為靜態庫。 我在項目文件夾中創建了“ bin”目錄,並將其放置在libvorbis_static.lib和libvorbisfile_static.lib中。 此外,我在bin目錄中的libvorbis文件夾中創建了一個文件夾,並在其中包含一個include文件夾,並在其中放置了vorbis(帶有codec.h,vorbisfile.h,vorbisenc.h)和ogg(帶有os_types.h和ogg.h)文件夾。 我將libvorbis_static.lib添加到項目的其他依賴項中,並將bin文件夾添加到其他庫目錄中。
當我嘗試編譯時,出現錯誤:
1>libvorbis_static.lib(info.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in libcmtd.lib(dbgfree.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _calloc already defined in libcmtd.lib(dbgcalloc.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in libcmtd.lib(dbgmalloc.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _realloc already defined in libcmtd.lib(dbgrealloc.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _memmove already defined in libcmtd.lib(memmove.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _ldexp already defined in libcmtd.lib(_ldexp_.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _qsort already defined in libcmtd.lib(qsort.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _ceil already defined in libcmtd.lib(_ceil_pentium4_.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _exit already defined in libcmtd.lib(crt0dat.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>BookDoc.obj : error LNK2001: unresolved external symbol _ogg_stream_clear
1>BookDoc.obj : error LNK2001: unresolved external symbol _ogg_page_eos
1>BookDoc.obj : error LNK2001: unresolved external symbol _ogg_stream_pageout
1>BookDoc.obj : error LNK2001: unresolved external symbol _ogg_stream_flush
1>BookDoc.obj : error LNK2001: unresolved external symbol _ogg_stream_packetin
1>BookDoc.obj : error LNK2001: unresolved external symbol _ogg_stream_init
1>libvorbis_static.lib(info.obj) : error LNK2001: unresolved external symbol _oggpack_readinit
1>libvorbis_static.lib(info.obj) : error LNK2001: unresolved external symbol _oggpack_bytes
1>libvorbis_static.lib(info.obj) : error LNK2001: unresolved external symbol _oggpack_writeclear
1>libvorbis_static.lib(info.obj) : error LNK2001: unresolved external symbol _oggpack_read
1>libvorbis_static.lib(info.obj) : error LNK2001: unresolved external symbol _oggpack_reset
1>libvorbis_static.lib(info.obj) : error LNK2001: unresolved external symbol _oggpack_write
1>libvorbis_static.lib(info.obj) : error LNK2001: unresolved external symbol _oggpack_writeinit
1>libvorbis_static.lib(bitrate.obj) : error LNK2001: unresolved external symbol _oggpack_writetrunc
1>libvorbis_static.lib(bitrate.obj) : error LNK2001: unresolved external symbol _oggpack_get_buffer
1>libvorbis_static.lib(codebook.obj) : error LNK2001: unresolved external symbol _oggpack_adv
1>libvorbis_static.lib(codebook.obj) : error LNK2001: unresolved external symbol _oggpack_look
1>.\Debug/Book.exe : fatal error LNK1120: 17 unresolved externals
我很困惑。 能否請你幫忙? 謝謝。
鏈接:警告LNK4098:defaultlib'MSVCRT'與其他庫的使用發生沖突; 使用/ NODEFAULTLIB:library
與orbis無關,這是在嘗試在同一程序中鏈接c stdlib和MFC的C stdlib時得到的-只需執行編譯器告訴您的操作即可。 或者只是將其設置為忽略libcmt / d
檢查您使用哪個c-runtime編譯了ogg-vorbis。 如果您要靜態鏈接,則它必須與您的應用程序匹配。
如果您已將vorbis編譯為DLL,則可以使用單獨的c運行時(如果vorbis DLL分配的內存始終由該DLL釋放,並且它是僅c的API)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.