Building and executing C code using azure

Rakshan N 1 Reputation point
2022-08-15T12:00:13.49+00:00

I am a beginner with CI and trying to wrap my head around how the CI file functions.

I have a simple project with a C file, which prints out some statements.

#include <stdio.h>      
int main(){      
printf("Hello C Language");      
printf("Hello C Language Again");   
return 0;     
}    

I have the CI file as shown below :

trigger:  
- main  
  
pool:  
  vmImage: ubuntu-latest  
  
steps:  
- script: echo Hello, world! lets start your pipeline  
  displayName: 'Run a one-line script'  
  
  
- task: Bash@3  
  inputs:  
    script: |  
     gcc -o test test.c  
      ./test  

Since I am using the ubuntu VM, I expect gcc to be installed by default. I pass the usual compiling and execution commands of C.

But I face an error

Response

What am I doing wrong here? Any links for me to grasp it better? Many thanks!

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,995 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 68,476 Reputation points
    2022-08-16T04:23:23.853+00:00

    Hi @Rakshan N

    Welcome to Microsoft Q&A! Thanks for posting the question.

    As per the screenshot you are creating the DevOps task. DevOps is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).
    You can ask the experts in the dedicated forum over here:
    https://stackoverflow.com/questions/tagged/devops
    https://developercommunity.visualstudio.com/spaces/21/index.html

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments