C++/构建项目出错
C++/ build project got errors
我在Visual Studio 2010中有下一个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
国际.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:UsersAdamshDocumentsVisual Studio 2010ProjectsInterDebugInter.exe', Symbols loaded.
'Inter.exe': Loaded 'C:WindowsSystem32ntdll.dll', Cannot find or open the PDB file
'Inter.exe': Loaded 'C:WindowsSystem32kernel32.dll', Cannot find or open the PDB file
'Inter.exe': Loaded 'C:WindowsSystem32msvcp100d.dll', Symbols loaded.
'Inter.exe': Loaded 'C:WindowsSystem32msvcr100d.dll', Symbols loaded.
The program '[3636] Inter.exe: Native' has exited with code 0 (0x0).
我该如何解决它?
AFAICS 作为特定于视觉C++的程序在技术上没有任何问题。
但是,它是不必要的编译器特定的。
特别是,将您的视觉C++替换为特定且无可救药的无意义的怪物
int _tmain(int argc, _TCHAR* argv[])
使用标准C++
int main()
若要调试程序,请在 Visual Studio 中选择"调试"版本而不是"发布"。
编辑:休息室里的人评论说,也许该计划对于OP来说完成得太快了?如果是这样,只需在 main
的右大括号上放置一个断点。
相关文章:
- 当我尝试通过 mingw 使用 CMake 和 SFML 库编译项目时出错
- 如何使用我构建的库,而不会从源代码出错,但不为我自己的项目编译?
- Flex/Bison:构建示例项目以生成 CPP 时出错
- 将项目导入 Android Studio 后出错
- 将 Dr. Memory 与 Visual Studio 项目配合使用时出错:缺少应用程序所需的库
- 使用 C++Builder 项目读取字符串中的文件时出错
- 在 Visual Studio 2015 中生成 vsal 项目时出错
- 创建新的 Visual Studio c++ 项目时出错
- 编译包含 CPLEX 工具的项目时出错
- CMake 和/或在为项目添加提升时出错
- 链接 gtest 项目时出错
- iOS:在真实设备上运行项目时出错
- 在qmake项目中编译sqlite时出错
- LNK1104将Boost库添加到Qt项目时出错
- 仅在从命令行构建Qt项目时出错
- 运行调试库项目时发布库出错
- Qt项目qmake在构建上出错
- 将VC++项目从VS2010升级到VS2012时出错
- 在c++项目中包含dlib库时出错
- 使用CMake编译OpenCV项目时出错