Home > Blockchain >  Cannot execute multiple file in c programming xCODE
Cannot execute multiple file in c programming xCODE

Time:02-04

As you can see above I have 1 file in my program second file is added. When i try to execute one of my file i encounter with this problem

Can you please help me with this error. Thank you.

I mentioned problem above

CodePudding user response:

You have two main functions in your project, one in each file. A C program can have only one main function.

Remove one of the main functions or rename one of them to get the project to build.

If you're writing lots of short C programs, you shouldn't use Xcode. With Xcode you have to create a new project for each program. Use a text editor like Visual Studio Code, TextMate, or Sublime Text instead. Text editors like these have bundles you can install that let you build and run C programs from within the editor.

  • Related