如何在jenkins上构建Cpp代码? [英] How to Build Cpp code on jenkins?

查看:114
本文介绍了如何在jenkins上构建Cpp代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Jenkins中执行一个批处理文件来构建一个cpp代码,我有一个命令来构建可执行文件,如g ++ sourcefile.cpp -o executablefile,它给出错误'g ++'不被认为是内部或外部命令。如何解决此问题

I am executing a batch file in Jenkins for building a cpp code and i have a command in between to build the executable like "g++ sourcefile.cpp -o executablefile" and it gives error 'g++' is not recognized as an internal or external command.How to Resolve this??

推荐答案

当Jenkins作为服务在Windows机器上运行时,系统帐户,而不是用户帐户(或您的帐户)。因此,您需要确保您为路径(等)设置所需的一切都是为系统帐户完成的,或包含在Jenkins中的Windows批处理脚本的一部分。 (我实际上对几个项目使用这个方法。)

When Jenkins is run as a service on a Windows machine it runs under the System account, not a user account (or your account). Therefore, you need to make sure that everything you need to setup for paths (etc.) is either done for the system account or included as part of your "Windows Batch Script" in Jenkins. (I actually use this method myself for several projects.)

要测试系统帐户是否可以进行编译,您需要打开一个CMD提示作为系统帐户。此问题应该可以帮助您解决问题:如何您在系统帐户下运行CMD。

To test if the System Account can do the compile, you need to open a CMD prompt as the System Account. This question should help you with taht: How Do You Run CMD under System Account.

这篇关于如何在jenkins上构建Cpp代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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