博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
VS 的编译选项 build下的 platform target -- Any CPU和x86有什么影响?
阅读量:4080 次
发布时间:2019-05-25

本文共 1795 字,大约阅读时间需要 5 分钟。

VS 的编译选项 build下的platform -- Any CPU和x86有什么影响?

现在的问题是,我的一个assembly用Any CPU编译就不能在64位系统下运行了,但是用x86编译就ok

 

原因是如果用Any CPU编译,那么在64位机器默认的运行就是64位的,

而我的assembly需要调用一个32的COM库,所以就运行不起来
只要用x86编译,那么程序就是以32位的程序,依靠wow64来运行的,所以就ok

 

所以,如果assembly需要使用win32库的话,

那么编译选项就不能使用默认的Any CPU了需要注意
 
我去,ANY CPU的意思不是任何CPU都可以用,而是当前编译的这台机子的环境可用
 
 
大家可再了解一下
Mixed Platform vs Any CPU
 
 Team Build deals with solution configurations - these are the platforms (e.g. .NET or Win32) and configurations (e.g. Debug or Release) you typically see in combo boxes within Visual Studio when you have a solution loaded (if you hover over these boxes the tooltips will say "Solution Platforms" and "Solution Configurations", respectively).  When all of the projects in a solution are of the same type (e.g. C#/VB projects) the solution configurations will match up exactly with the project configurations.  Once you have projects in a solution that have mismatched configurations/platforms, Visual Studio creates the solution level configuration(s) "Mixed Platforms/Debug" and possibly "Mixed Platforms/Release".  These configurations are just mappings to individual project level configurations.
      For example, if you have a C# project and a C++ project, typically "Mixed Platforms/Debug" will map to "Any CPU/Debug" for the C# project and "Win32/Debug" for the C++ project.  
      To see these mappings, open up the Configuration Manager (either through the Build menu or by clicking on the platform or configuration combo box and selecting Configuration Manager...).  You should see combo boxes for the Active solution configuration and the Active solution platform and then a table showing you the project level mappings.  This will show you the platform generated for each project under each solution configuration.
 

posted on 2016-07-02 14:37 阅读(...) 评论(...)

转载地址:http://eivni.baihongyu.com/

你可能感兴趣的文章
IntelliJ IDEA 下的svn配置及使用的非常详细的图文总结
查看>>
【IntelliJ IDEA】idea导入项目只显示项目中的文件,不显示项目结构
查看>>
ssh 如何方便的切换到其他节点??
查看>>
JSP中文乱码总结
查看>>
Java实现DES加密解密
查看>>
HTML基础
查看>>
Java IO
查看>>
Java NIO
查看>>
Java大数据:Hbase分布式存储入门
查看>>
大数据学习:Spark RDD操作入门
查看>>
大数据框架:Spark 生态实时流计算
查看>>
大数据入门:Hive和Hbase区别对比
查看>>
大数据入门:ZooKeeper工作原理
查看>>
大数据入门:Zookeeper结构体系
查看>>
大数据入门:Spark RDD基础概念
查看>>
大数据入门:SparkCore开发调优原则
查看>>
大数据入门:Java和Scala编程对比
查看>>
大数据入门:Scala函数式编程
查看>>
【数据结构周周练】002顺序表与链表
查看>>
C++报错:C4700:使用了非初始化的局部变量
查看>>