试图了解将文件添加到VS项目简单的任务 [英] Trying to understand simple task of adding files to VS projects

查看:158
本文介绍了试图了解将文件添加到VS项目简单的任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如我以前说过,我还在学习。每在这个previous帖子的意见,我尝试将文件添加到现有项目,而不是包括它。该人士$ ​​C $ C被列在previous职位。我用这些说明将文件添加到项目中。我改名包含文件从FilMst5.c到FilMst5.cpp避免以下错误:

As I said before, I'm still learning. Per the comments in this previous post, I'm trying to add a file into an existing project, rather than including it. The source code is listed in the previous post. I used these instructions to add the file to the project. I renamed the include file from FilMst5.c to FilMst5.cpp to avoid the following error:

C1853'的x64 \\调试\\ CrtFil5.pch'precompiled头文件是从编译器的previous版本,或precompiled头是C ++,并且您使用从C(反之亦然)

我还添加了的#includestdafx.h中来prevent另一个编译错误消息。当我试图编译该项目的文件,我得到了2个消息'FilMstFilPtr':未声明的标识符和另一个消息OPN:标识符没有找到。所以我知道我做错事,但我实在不明白它是如何在本来为了解决它的工作。谁能告诉我正确的方式做到这一点?

I also added #include "stdafx.h" to prevent another compile error message. When I tried to compile the project files, I got 2 messages 'FilMstFilPtr': undeclared identifier and another message 'Opn': identifier not found. So I know I'm doing something wrong, but I don't really understand how it's supposed to work in order to fix it. Can someone tell me the correct way to do this?

的C code previously编译的,即使它有一个.cpp扩展名,顺便Visual Studio中做的事情。精

The C code previously compiled fine even though it has a .cpp extension, the way Visual Studio does things.

推荐答案

我的人在这个问题上浪费时间表示歉意。我只需要必要的声明在头文件和链接器把它的其余部分。

I apologize for anyone wasting time on this question. I just needed the necessary declarations in a header file, and the linker took care of the rest of it.

这篇关于试图了解将文件添加到VS项目简单的任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆