VC/MFC动态库Debug版本下正常,Release版本下错误
在网上找了一个用MFC编写基于VLC类库的播放器的例子,也可以播放各种格式的视频,结果发现该例子有问题如下:在Debug模式下,可以正常播放。在Release模式下,仅编...
在网上找了一个用MFC编写基于VLC类库的播放器的例子,也可以播放各种格式的视频,结果发现该例子有问题如下:
在Debug模式下,可以正常播放。
在Release模式下,仅编译就出现了18个链接的warning,一打开视频文件时就弹出应用程序错误。
int vlc_argc = 0;
char *vlc_argv[100];
vlc_argv[vlc_argc++] = "--ignore-config";
p_instance[1] = libvlc_new(vlc_argc, vlc_argv, NULL);
libvlc_media_t *p_media = libvlc_media_new(p_instance[1], m_VideoPath[1],NULL);
p_media_player[1] = libvlc_media_player_new_from_media(p_media, NULL);
libvlc_media_player_set_drawable(p_media_player[1], (libvlc_drawable_t)m_StaticDisplay[1]->m_hWnd, NULL);
//各相应变量均在头文件中定义了,调用的函数声明位于:libvlc.h 中, 好像是从libvlc.dll的动态库中调用的
//具体原理都封装了起来,看不到所以我也不太清楚
其中链接警告如下:
LINK : warning LNK4089: all references to "d000000.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000008.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000010.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000106.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000116.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000118.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000120.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000126.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000127.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000128.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000129.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000132.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000134.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000135.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000137.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000144.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000164.o" discarded by /OPT:REF
注:我的.lib文件是添加在资源里的,Debug和Release的配置全是新建工程时的默认配置
以上的问题是怎么造成的,该怎么解决呢?望高手解答。。。急急急!
你们没明白我的意思, 我的程序在Release下虽然有警告,但是能跑起来,只是在打开视频文件的时候出错了,但在Debug下打开视频文件没有问题,估计是我描述的不太准确 展开
在Debug模式下,可以正常播放。
在Release模式下,仅编译就出现了18个链接的warning,一打开视频文件时就弹出应用程序错误。
int vlc_argc = 0;
char *vlc_argv[100];
vlc_argv[vlc_argc++] = "--ignore-config";
p_instance[1] = libvlc_new(vlc_argc, vlc_argv, NULL);
libvlc_media_t *p_media = libvlc_media_new(p_instance[1], m_VideoPath[1],NULL);
p_media_player[1] = libvlc_media_player_new_from_media(p_media, NULL);
libvlc_media_player_set_drawable(p_media_player[1], (libvlc_drawable_t)m_StaticDisplay[1]->m_hWnd, NULL);
//各相应变量均在头文件中定义了,调用的函数声明位于:libvlc.h 中, 好像是从libvlc.dll的动态库中调用的
//具体原理都封装了起来,看不到所以我也不太清楚
其中链接警告如下:
LINK : warning LNK4089: all references to "d000000.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000008.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000010.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000106.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000116.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000118.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000120.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000126.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000127.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000128.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000129.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000132.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000134.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000135.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000137.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000144.o" discarded by /OPT:REF
LINK : warning LNK4089: all references to "d000164.o" discarded by /OPT:REF
注:我的.lib文件是添加在资源里的,Debug和Release的配置全是新建工程时的默认配置
以上的问题是怎么造成的,该怎么解决呢?望高手解答。。。急急急!
你们没明白我的意思, 我的程序在Release下虽然有警告,但是能跑起来,只是在打开视频文件的时候出错了,但在Debug下打开视频文件没有问题,估计是我描述的不太准确 展开
4个回答
展开全部
Rebuild试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
编译器问题 也许换下vs 就行了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
all references to "d000000.o" discarded by /OPT:REF
这句话的意思是/在OPT:REF的指令下对“D000000。O的引用无效
所以,试看去掉/OPT:REF这个选项再RELEASE
这句话的意思是/在OPT:REF的指令下对“D000000。O的引用无效
所以,试看去掉/OPT:REF这个选项再RELEASE
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询