问题
I am using QTranslator in VS 2010. When using the process below I get an error saying the add-on has exited with an error (Exitcode 1). I have been through the whole process (code to executable with translations working) using Qt Linguist and Qt Creator. However, I cannot even create the ts file in Visual Studio (add on menus all where they should be). Anyone any ideas why please?
Creating Qt Translation Files for the Project To add a new translation file to the project, select Qt|Create New Translation File. In the Add Translation dialog, you can choose the language to create a translation file. A suggested file name is provided, and will be created when you click OK. The translation file is placed in the Translation Files folder in Visual Studio's Solution Explorer. Right-clicking on a translation file displays a menu that allows you to invoke lupdate, lrelease, and Qt Linguist.
回答1:
With the qt add-in version 1.1.11, I experienced a similar error. I made a translation (VS 2010 File Menu > Qt > Create New Translation) and sometime later when I did a build after having two translations in place it gave the error ExitCode 1 for the Qt Add in.
After just clicking Ok on this error dialog for a few days each time I built, I found that listed in the output, there is a combo box for the source of the output.
Change this combo box from "Debug" to "Qt Visual Studio Add-in", and then you should see the source of the error in the output. For me, one of the ts files had a line that couldn't be parsed. I deleted that ts file and created a new one, and the error went away.
Hope that helps.
来源:https://stackoverflow.com/questions/11719427/qt-creating-new-translation-ts-using-visual-gives-error-exitcode-1