繁体   English   中英

将ogg vorbis编码添加到我的项目中

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM