通过源代码设置构建名称 [英] build name set through source code

查看:120
本文介绍了通过源代码设置构建名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 



有没有办法通过源代码中的变量设置构建名称?我正在使用C ++语言。 


我一直在尝试使用#define指令定义dll名称,然后在属性中重用常量。然而,最终在很多地方取代,仍然没有设法让它工作。我想知道是否有更有条理的方式呢?


谢谢

解决方案


嗨 



有没有办法通过源代码中的变量设置构建名称?我正在使用C ++语言。 


我一直在尝试使用#define指令定义dll名称,然后在属性中重用常量。然而,最终在很多地方取代,仍然没有设法让它工作。我想知道是否有更有条理的方式吗?


谢谢


创建的dll的名称典型DLL项目的VC ++由Target Name的属性页面设置决定,默认为项目名称。 例如,



如果您在VS IDE中构建,则可以通过更改该属性来设置dll名称。 不要忘记您必须在每个配置和平台上进行更改。


还可以使用环境变量而不是

(ProjectName)宏。


另一种可能性是使用msbuild从命令行构建dll并在命令行中指定TargetName属性。







Hi 

Is there way to set build name through a variable in a source code? I am using C++ language. 

I have been trying to use #define directive to define dll name and then in properties to to reuse the constant. However, end up replacing in so many places and still haven't managed to get it working. I wonder if there is more organised way of doing it?

Thanks

解决方案

Hi 

Is there way to set build name through a variable in a source code? I am using C++ language. 

I have been trying to use #define directive to define dll name and then in properties to to reuse the constant. However, end up replacing in so many places and still haven't managed to get it working. I wonder if there is more organised way of doing it?

Thanks

The name of a dll created by VC++ for a typical dll project is determined by the property page setting for Target Name which defaults to the name of the project.  For example ,

If you are building in the VS IDE you set the dll name by changing that property.  Don't forget that the changes you make must be made in each configuration and platform.

It is also possible to change the name of the dll by using an environment variable instead of the


(ProjectName) macro.

Another possibility is building the dll from the command line using msbuild and specifying the TargetName property in the command line.




这篇关于通过源代码设置构建名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆