[英]C++/CLI CS0246: The type or namespace name 'Wrapper' could not be found
I am encountering an issue that seems identical to this one . 我遇到的问题似乎与此相同。
I have a VS 2008 solution that includes, among other things: (names changed for simplicity) 我有一个VS 2008解决方案,其中包括:(为简单起见,更改了名称)
When I build the EXE, VS gives me an error: 当我生成EXE时,VS给我一个错误:
error CS0246: The type or namespace name 'Wrapper' could not be found (are you missing a using directive or an assembly reference?)
However: 然而:
The first linked question mentions something about a "duplicate definition of a compiler symbol", but I'm not sure what to look for in that sense. 第一个链接的问题提到了有关“编译器符号的重复定义”的内容,但是我不确定从这个意义上看要寻找什么。
Any ideas for what to try? 有什么想法可以尝试吗?
I think I figured this out. 我想我明白了。
Some more background: before building, the entire solution is created using CMake. 更多背景知识:在构建之前,将使用CMake创建整个解决方案。 I use CMake to make some edits to the csproj file for the EXE to point it to the correct references, including DLL B. 我使用CMake对EXE的csproj文件进行一些编辑,以使其指向正确的引用,包括DLLB。
Whenever I run CMake, the statically defined GUID for DLL B in the ProjectReference node of the csproj file gets out of sync with the newly generated GUID for the vcproj that outputs DLL B. This GUID mismatch causes DLL B not to be referenced at build time , even though it shows up in the list of references and there are no related warnings or errors. 每当我运行CMake时,csproj文件的ProjectReference节点中DLL B的静态定义的GUID与输出DLL B的vcproj的新生成的GUID不同步。此GUID不匹配会导致在构建时不引用DLL B ,即使它显示在参考列表中,也没有相关的警告或错误。
The way I discovered this was by looking at the build output. 我发现此问题的方法是查看构建输出。 In the call to csc.exe, there was no '/reference' entry for DLL B. 在对csc.exe的调用中,DLL B没有“ /引用”条目。
Now I need to find a way to keep these GUIDs in sync! 现在,我需要找到一种方法来使这些GUID保持同步!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.