无法使用代码1编译程序出口

时间:2014-03-01 06:53:02

标签: c++ opencv dll computer-vision

我正在使用opencv,c ++和Microsoft Visual Studio 2010来编译我的代码,但我得到了所有这些。

'herohuyongtao.exe': Loaded 'C:\Users\DELL\Documents\Visual Studio 2010\Projects\herohuyongtao\Debug\herohuyongtao.exe', Symbols loaded.
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Program Files\AVAST Software\Avast\snxhk.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_core242d.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'herohuyongtao.exe': Loaded 'C:\opencv\build\common\tbb\ia32\vc10\tbb_debug.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_highgui242d.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5\comctl32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\msvfw32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\avicap32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_imgproc242d.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_objdetect242d.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'herohuyongtao.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file

最后它说

The program '[6728] herohuyongtao.exe: Native' has exited with code 1 (0x1).

显然这些都不是错误。我尝试了几种解决方案但没有结果。有人可以帮忙吗?

3 个答案:

答案 0 :(得分:1)

Cannot compile program-exits with code 1

这是一个错误的陈述。您的程序编译成功。但是当你启动它时执行并退出代码1.你需要放置断点并通过程序查看它退出的位置。

答案 1 :(得分:1)

你的程序有几个潜在的exit点,返回代码为1,但有一个特别让我感到震惊:

//int main( int argc, char** argv )
if (argc == 1)
{
    exit(1);
}

由于其他exit调用之前有printf次调用,原始问题中的示例输出没有与printf次调用匹配的输出,我猜这个特别的(无声) )exit电话是负责任的。你传递程序的参数是多少?

答案 2 :(得分:0)

经过一番讨论,结果发现代码没有收到所需的参数。代码需要这些参数:

input output width height

input是输入视频或“”以使用网络摄像头。 output是输出视频文件。 widthheight是相机框架的宽度和高度。

所以这应该按预期工作:

"" "myOutputVideo.avi" "320" "240"