Reputation: 573
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??
Upvotes: 2
Views: 8477
Reputation: 7048
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.)
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.
Upvotes: 2
Reputation: 25723
PATH
of your system to the folder that contains gcc.exe
, g++.exe
Upvotes: 1