使用Boost库Qt C ++更新翻译文件(Update translation file using Boost library Qt C++)

编程入门 行业动态 更新时间:2024-10-20 21:01:23
使用Boost库Qt C ++更新翻译文件(Update translation file using Boost library Qt C++)

我在我的C ++项目中使用Boost库。

我将它包含在PRO文件中,如下所示:

win32: INCLUDEPATH += C:/boost_1_60_0 win32: LIBS += "-LC:/boost_1_60_0/stage/lib/"

但是,当我在终端(cmd)上运行以下命令来更新我的翻译文件时:

lupdate MyProject.pro

它会在Boost库路径中搜索要更新的文件。

这是正常的吗? 如果不在Boost库路径中搜索,我该怎么办?

现在,当我需要运行lupdate命令时,我正在评论Boost包含行,但我不想每次需要更新我的翻译文件时都这样做。

Qt 5.3.2

提升1.6.0

I am using the Boost library in my C++ project.

I am including it in the PRO file like this:

win32: INCLUDEPATH += C:/boost_1_60_0 win32: LIBS += "-LC:/boost_1_60_0/stage/lib/"

But, when I run the following command on the terminal (cmd) to update my translation file:

lupdate MyProject.pro

It searchs for files in the Boost library path to update.

Is this normal? What can I do to not search in the Boost library path?

Now, I am commenting the Boost include lines when I need to run the lupdate command, but I don't want to do it every time I need to update my translation file.

Qt 5.3.2

Boost 1.6.0

最满意答案

错误报告( QTBUG-27936 )中有一个解决方法,涉及.pro项目中的TR_EXCLUDE选项。 它用于告诉lupdate排除某些文件。 我测试了Qt 5.6和5.8,它按预期工作。 这里有我的.pro文件的摘录:

INCLUDEPATH += /Users/user/libs/boost TR_EXCLUDE += /Users/user/libs/boost/*

以前的答案这是以前的答案,我无法确认,而且它恰好是错误的。 我把它放在这里,所以它保存在文件中。 错误报告( QTBUG-27936 )中有一个解决方法,它包括预编译头中的所有Boost库,因为lupdate不会查看它。

There is a workaround in the bug report (QTBUG-27936), involving the TR_EXCLUDE option in the .pro project. It is used to tell lupdate to exclude certain files. I tested with Qt 5.6 and 5.8 and it worked as expected. Here there is the extract of my .pro file:

INCLUDEPATH += /Users/user/libs/boost TR_EXCLUDE += /Users/user/libs/boost/*

PREVIOUS ANSWER This is the previous answer, which I couldn't confirm and it happens to be wrong. I'm letting it here so it's kept documented. There is a workaround in the bug report (QTBUG-27936), which is to include all Boost libraries in the precompiled header, since lupdate doesn't look at it.

更多推荐

本文发布于:2023-08-07 10:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463760.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   Qt   Boost   Update   library

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!