2012-04-29 38 views
-1

我在Visual Studio 2010中的C++的下一個文件:C++ /建設項目得到了錯誤

stdafx.h 


// stdafx.h : include file for standard system include files, 
// or project specific include files that are used frequently, but 
// are changed infrequently 
// 
#pragma once 

#include "targetver.h" 

#include <stdio.h> 
#include <tchar.h> 

void printHello(); 
// TODO: reference additional headers your program requires here 

inter.cpp

// Inter.cpp : Defines the entry point for the console application. 
// 

#include "stdafx.h" 
#include <iostream> 

int _tmain(int argc, _TCHAR* argv[]) 
{ 
    printHello(); 
} 

stdafx.cpp

// stdafx.cpp : source file that includes just the standard includes 
// Inter.pch will be the pre-compiled header 
// stdafx.obj will contain the pre-compiled type information 

#include "stdafx.h" 
#include <iostream> 

// TODO: reference any additional headers you need in STDAFX.H 
// and not in this file 
void printHello() { 
    std::cout << "Hello World!" << std::endl; 
} 

和我明白了:

'Inter.exe': Loaded 'C:\Users\Adamsh\Documents\Visual Studio 2010\Projects\Inter\Debug\Inter.exe', Symbols loaded. 
'Inter.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file 
'Inter.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file 
'Inter.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded. 
'Inter.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded. 
The program '[3636] Inter.exe: Native' has exited with code 0 (0x0). 

我該如何解決?

+3

假設您沒有ntdll和kernel32的調試信息,這看起來完全正常。 – Flexo

+0

你想解決什麼? –

+0

@LuchianGrigore:最後一行是問題,不是?因爲我沒有看到「Hello world!」輸出 –

回答

1

AFAICS沒有什麼在技術上作爲Visual C++特定程序錯誤與您的程序。

但是,它是不必要的編譯器特定的。

特別是,一個標準的C++

int main() 

對於調試程序,在Visual Studio中替換您的Visual C++具體和絕望無意義的怪物

int _tmain(int argc, _TCHAR* argv[]) 

選擇 「調試」 構建,而不是「發佈」。

編輯:酒廊裏的人們評論說可能程序對OP來說太快了?如果是這樣,只需在main的大括號上放置一個斷點。