我是Visual Studio 2010中的项目配置的新手,但我做了一些研究,但仍然不能完全解决这个问题.我有一个Visual Studio解决方案,其中包含引用C#DLL的C++ DLL.C#DLL引用了一些其他的DLL,一些在我的项目中,一些在外部.当我尝试编译C++ DLL时,我收到此警告:
警告MSB3270:正在构建"MSIL"的项目的处理器体系结构与参考"[internal C#dll]","x86"的处理器体系结构之间存在不匹配.
它告诉我去配置管理器来调整我的架构.C#DLL使用平台目标x86进行设置.如果我尝试将其更改为其他内容,例如Any CPU,则会抱怨,因为它所依赖的外部DLL之一具有平台目标x86.
当我查看Configuration Manager时,它将我的C#DLL平台显示为x86,将我的C++项目显示为Win32.这似乎是正确的设置; 当然我不希望我的C++项目的项目将平台设置为x64,这是唯一提供的其他选项.
我在这做错了什么?
所以我想在R中的矩阵上应用一个函数.这对于简单函数非常直观:
> (function(x)x*x)(matrix(1:10, nrow=2))
[,1] [,2] [,3] [,4] [,5]
[1,] 1 9 25 49 81
[2,] 4 16 36 64 100
Run Code Online (Sandbox Code Playgroud)
......但显然我不了解它的所有工作原理:
> m = (matrix(1:10, nrow=2))
> (function(x) if (x %% 3 == 0) { return(NA) } else { return(x+1) })(m)
[,1] [,2] [,3] [,4] [,5]
[1,] 2 4 6 8 10
[2,] 3 5 7 9 11
Warning message:
In if (x == 3) { :
the condition has length > 1 and only the first element will …Run Code Online (Sandbox Code Playgroud) 我有一个混合使用Visual Studio 2010构建的C#/托管C++ /非托管C++的工具.代码实际上分布在.exe(我称之为mybinary.exe)和.dll(mylib.dll).
我在项目中为dll和exe设置了构建设置,以便在发布版本中生成PDB文件.我已经确定PDB文件都在exe和pdb所在的目录中.但是当我调试这个程序时,我仍然看不到函数的名称; 我只看到地址.这是我在Very Sleepy的第一个屏幕中选择程序时在底部的小状态栏中获得的相关摘录:
DBGHELP: mybinary.vshost - public symbols
C:\Users\(me)\AppData\Local\sleepy\vshost32-clr2.pdb\(long hex string)\vshost32-clr2.pdb
...
DBGHELP: No debug info for C:\myproj\mylib.dll. Searching for dbg file
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\symbols\dll\mylib.dbg - path not found
SYMSRV: C:\Users\peastlund\AppData\Local\sleepy\mylib.dbg\4EF1F48B13c000\mylib.dbg not found
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\symbols\dll\mylib.dbg - path not found
DBGHELP: C:\myproj\mylib.dbg - file not found
DBGHELP: C:\myproj\mylib.dll missing debug info. Searching for pdb …Run Code Online (Sandbox Code Playgroud)