当前位置:首页 » 编程软件 » 2010如何编译

2010如何编译

发布时间: 2022-11-25 23:26:46

‘壹’ Visual Studio 2010中的Visual C++如何编译、连接和运行

1.首先打开vs2010,选择“visualc++开发设置”,点击“”启动visualStudio。

‘贰’ 如何在VS2010中运行编译C和C++

VS2010需要先新建工程项目,接着在源文件中添加cpp文件,然后再编写代码,最后编译运行就可以,下面是创建执行C++程序的步骤:

1、首先新建项目(文件-->新建-->项目)

‘叁’ Microsoft Visual Studio 2010 怎么编译,怎么运行

打开visual studio,然后点击文件--》新建项目,在弹出的对话框中选择你要编译的语言(如fortran),然后新建一个empty project,命名后点击确定。这样在visual studio的右侧就可以看到你的project。再在source files中添加你的程序。就可以编译了。运行和编译都可以在调试的菜单下找到。 赞同0| 评论

‘肆’ 如何在VS2010中运行编译C和C++

在从基础语言上去说:

1、原则上,VS主要面对win进行开发,VS2010支持C++语言。
2、C++语言环境原理上兼容C。
3、针对win进行的编程的C++一般都能移植到VS2010中,但一般来说,直接打开不同版本的VC++的工程并不能确定都能顺利编译,需要根据实际情况进行转换、调整。低版本的VS一般打不开高版本VS生成的工程。跨版本太大的一般不能自动转换,比如用VS2010去打开VC6.0生成的工程。
4、c语言编程一般都是很早期的代码,很多针对DOS设计,所以,在VS2010中很多代码是运行不过的,而且所使用的库文件、函数名、定义都有很多不同,所以,想要顺利编译通过,多数情况下很难,需要做大量的修正。当然,如果只是一些练习和教学性的代码,懂的人稍作修改,也可以在VS2010下进行测试与练习,不过DOS与WIN,在编程上有很大差别,基本上不是一回事。

‘伍’ 求教关于用 VS2010用命令行如何 编译C++工程 (最好有详细示例)

用法:
devenv
[解决方案文件
|
项目文件
|
任意文件.扩展名]
[开关]
devenv
的第一个参数通常是一个解决方案文件或项目文件。
如果您希望在编辑器中自动打开文件,
也可以使用任何其他文件作为第一个参数。当您输入项目文件时,ide
会在项目文件的父目录中查找与该项目文件具有相同
基名称的
.sln
文件。如果不存在这样的
.sln
文件,
ide
将查找引用该项目的单个
.sln
文件。如果不存在这样的单个
.sln
文件,则
ide
将创建一个具有默认
.sln
文件名的未保存
的解决方案,其基名称与项目文件的基名称相同。

‘陆’ vs2010如何编译驱动

1、安装VS2010,安装WDK 7.0(DDK);

2、新建VC++->Empty Project

3、打开Configuration Manager 并新建一个名称为“ dirver ”的Solution Configuration 并将“dirver” 设为Active Solution Configuration .

4、打开View-> property Manager。

5、在"dirver" solution configuration 上点击右键,选择Add new property Sheet。取名为“dirverProperty”. 并对他进下以下设置。

5.1. C\C++ - General - Debug Information Format = Program Database (/Zi)
5.2. C\C++ - Preprocessor - Preprocessor Definitions = _X86_ [add also DBG for Debug config]
【WIN32;_DEBUG;_X86_;i386;STD_CALL;CONDITION_HANDLING;WIN32_LEAN_AND_MEAN;NT_UP;SRVDBG;DBG;_IDWBUILD;_WIN32_WINNT=0x0400;% (PreprocessorDefinitions)】
5.3. C\C++ - Code Generation - Enable C++ Exceptions = No
5.4. C\C++ - Code Generation - Basic Runtime Checks = Default
5.5. C\C++ - Code Generation - Buffer Security Check = No (/GS-)
5.6. C\C++ - Advanced - Calling Convention = __stdcall (/Gz)
5.7. C\C++ - Advanced - Compile As = Compile as C Code (/TC) [if you are going to use plain C]
5.8. Linker - General - Output File = $(OutDir)\$(ProjectName).sys
5.9. Linker - General - Enable Incremental Linking = Default
5.10. Linker - Input - Additional Dependencies = ntoskrnl.lib hal.lib $(NOINHERIT) [add here needed libs here e.g. ntoskrnl.lib hal.lib]
【不知道上面是不是笔误,应该为:ntoskrnl.lib;hal.lib;%(AdditionalDependencies)】
5.11. Linker - Input - Ignore All Default Libraries = Yes (/NODEFAULTLIB)
5.12. Linker - Manifest File - Generate Manifest = No
5.13. Linker - System - SubSystem = Native (/SUBSYSTEM:NATIVE)
5.14. Linker - System - Driver = Driver (/DRIVER)
5.15. Linker - Advanced - Entry Point = DriverEntry
5.16. Linker - Advanced - Base Address = 0x10000
5.17. Linker - Advanced - Randomized Base Address = Disable (/DYNAMICBASE:NO)
【这个也是错误的:应该置空】
5.18. Linker - Advanced - Data Execution Prevention (DEP) = Disable (/NXCOMPAT:NO)
【这个也是错误的:应该置空】

6. Config VC++ Directories
6.1 Open Open up property manager by clicking on Menu View->Property Manager.
6.2 Expand the project node and then the Configuration|Platform nodes, you will see "Microsoft.cpp.<Platform>.users" file for each Configuration|Platform. These are the files

for the global settings, similar to the old tools/Options/VC++ Directories.
6.3 Multi-Select "Microsoft.cpp.<Platform>.users", right click and bring up the property page window
6.4 In the property page window, click on "VC++ Directories" (for example) in the left pane, add new paths for the directories such as "Include Directories". separated by

semicolons
(eg:Include Directories config As:
$(ddkroot)\INC
$(ddkroot)\INC\WNET
$(ddkroot)\INC\DDK\WNET
Library Directories config As:
$(ddkroot)\LIB\WNET\I386
)
6.5 Make sure to save the settings before shutting down Visual Studio.
6.6 Re-launch Visual Studio and the new settings will be in effect.
6.7 Note: If you would like to only change the settings for one project, you can right click on the project and bring up the property page. Change the settings for “VC++

Directories”, these settings will be persisted to the project file.
七. OK. Have done. Now you can test it with simple code, e.g.:

#include "ntddk.h"

NTSTATUS
DriverEntry(PDRIVER_OBJECT DriverObject,PUNICODE_STRING RegistryPath)
{
return STATUS_UNSUCCESSFUL;
}

特别说明:
1.
Visual Studio 2010 在智能设备开发方面只支持Windows Phone OS 7.0。如果你要为Windows CE 5.0和Windows Mobile 6.5开发应用程序,请安装Visual Studio 2008。
2.
做驱动开发时,SDK的版本要和WDK的版本一致,即Win7 WDK要配Win7 SDK,否则会出现编译错误。VS2010里集成了Windows SDK 7.0A。
3.
如果出现类似如下编译错误,解决方法是:拷贝C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sal.h,然后覆盖掉C:\WinDDK\7600.16385.1\inc\api\sal.h。

C:\Program Files\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2143: syntax error : missing ')' before 'const'
C:\Program Files\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2143: syntax error : missing '{' before 'const'
.......

‘柒’ vc2010怎么进行c语言编译

1,在windows桌面中Visual Studio打开软件并新建项目。

‘捌’ 命令行下编译vs2010工程怎么做

1.找到vs的cl.exe所在目录,在vs2010为f:\visual
2010\vc\bin,可参考。
2.点击“我的电脑”进行环境变量的配置,找到"path"变量加分号后加入刚才的路径。
3.重新运行cmd开启新的命令窗口,输入cl检查path设置是否生效。(只需配置一次即可,以后再次运行的时候不用再运行此命令)。
4.输入vcvars32,这条命令是运行同路径下的vcvars32.bat设置它的环境变量。
5.输入cl
hello.cpp即可正常编译。
编译工程有两个方法:
"c:\program
files\microsoft
visual
studio
10.0\common7\ide\devenv.exe"
/rebuild
"release|win32"
xxxxxxxxx.sln
专门的build工具:msbuild,通过开始菜单=>microsoft
visual
studio
2010=>visual
studio
tools=>visual
studio
command
prompt
(2010)
,启动命令行环境,执行一下msbuild

‘玖’ 用VS2010怎么编译,调试,运行Vc++文件

以HelloWorld为例 打开VS2010 文件->新建->项目-> 左边安装的模版中,选中Visual C++ 中间选择Win32控制台应用程序,输入项目名称 点击确定->下一步->完成,或者直接点完成 VS2010写了一些代码,可以删掉,然后自己写 #include"stdafx.h" //这个在VS2010得写上 #include<iostream> using namespace std; void main() { cout<<"HelloWord"; } 运行的时候,菜单栏->调试->开始执行(不调试),这样程序会在结尾处停止 如果选启动调试,程序就会直接执行完,看不到结果 编译,就是菜单栏->生成->生成解决方案,或者第四项:生成+(项目名称),或者最后一项,编译 都是同样的效果.

热点内容
云隙服务器下载 发布:2024-05-19 04:33:22 浏览:312
德国C语言 发布:2024-05-19 04:13:40 浏览:959
音频管理器没有文件夹 发布:2024-05-19 04:13:36 浏览:666
qq邮箱端口993服务器怎么填 发布:2024-05-19 04:07:05 浏览:202
javaapi框架 发布:2024-05-19 04:06:59 浏览:359
与存储结构无关的术语 发布:2024-05-19 04:05:41 浏览:499
编译路由器固件选择 发布:2024-05-19 03:56:28 浏览:39
手机f加密 发布:2024-05-19 03:28:47 浏览:225
用什么密码写日记 发布:2024-05-19 03:27:57 浏览:303
数据库access2003 发布:2024-05-19 02:49:39 浏览:620