2014-03-01 50 views
0

我正在使用opencv,C++和Microsoft Visual Studio 2010來編譯我的代碼,但是我得到了所有這些。無法用代碼1編譯程序出口

'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). 

Apparenly這些都不是errors.I嘗試了幾種解決方案,但沒有結果。任何人都可以幫忙嗎?

+1

您是否嘗試過調試程序?逐步瞭解它爲什麼會發生? – Borgleader

+1

您的程序已編譯或者您無法在調試器中運行它。至少發佈主要功能。 –

+1

「無法找到或打開PDB文件」註釋意味着MSVC無法加載指定文件的調試信息。這通常不是什麼大問題,因爲這些主要是系統庫。 – computerfreaker

回答

0

經過一番討論後,結果證明代碼沒有收到它需要的參數。該代碼需要這些參數:

input output width height 

input是一個輸入視頻或「」使用攝像頭。 output是一個輸出視頻文件。 widthheight是相機框架的寬度和高度。

所以這應該工作打算:

"" "myOutputVideo.avi" "320" "240" 
1
Cannot compile program-exits with code 1 

這是錯誤的說法。您的程序成功編譯。但是當你啓動它時,它會執行代碼1並退出。你需要放置斷點並通過程序來查看它退出的位置。

+1

這不比回答更好嗎? – computerfreaker

+0

如果沒有足夠的信息來正確回答問題,則沒有其他選擇。 OP現在已經發布了代碼,這意味着現在可以做出正確的回答。 – computerfreaker

1

你的程序有幾個潛在exit點爲1的返回代碼,但是有一個特別是給我的印象:

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

由於其它exit通話面前有printf電話,和樣品輸出你原來的問題沒有輸出匹配那些printf調用,我猜這個特定(無聲)exit調用是負責任的。你傳遞你的程序有多少個參數?

+0

好的我評論了這個,如果零件和控制檯窗口出現「結構模型加載在23s」。該程序應該激活我的攝像頭。這個錯誤顯然是在第218行找到的,因爲那裏有一個黃色的箭頭 – Steph

+1

我真的認爲你需要看看你通過你的程序有多少個參數。很多設置代碼都是依賴於argc的:代碼的條件是'argc> 1','argc> 2'和'argc> 4'。如果你沒有傳遞足夠的參數,我認爲你的很多設置代碼可能會中斷。特別是,我猜'argc == 1'(因此你沉默'退出'),因此你的'框架'永遠不會被設置。 – computerfreaker

+0

攝像頭將需要提取框架,其寬度和高度。所以,我認爲這些將是它的參數。我真的沒有看到代碼中的任何錯誤。 – Steph