简体   繁体   English

Visual Studio中的资源文件

[英]resource files in visual studio

I have included an obj(Wavefront .obj file) file as a resource with the attributes Build action: None and Do not copy. 我已经将obj(Wavefront .obj文件)文件作为具有属性Build action: None and Do not的资源包括在内Build action: None and Do not copy.

How can I access these files from a c++ file later?. 以后如何从c ++文件访问这些文件? The resource file is in ac# project which is being compiled to an exe file. 资源文件在ac#项目中,正在被编译为exe文件。 And the project where I want to access these resources are from a dll file? 我要访问这些资源的项目来自dll文件?

If I change to Always copy I can access the file using the normal way: 如果更改为始终复制,则可以使用常规方式访问文件:

ifstream file("Resources\\file.obj");

You can solve this by right-clicking your ".obj" resource file. 您可以通过右键单击“ .obj”资源文件来解决此问题。 Go to "properties" and make sure "Exclude From Build" is set to "Yes." 转到“属性”,并确保将“从生成中排除”设置为“是”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM