6 Replies Latest reply on Jun 9, 2014 6:30 AM by DaHu_285096

    No return from Main() Creator version 3

    DaHu_285096

       Is there a fix or setting adjustment for the main.c main loop code created?

         

      Every new project I create sets up main loop "void main()" which results in warning that main does not return "int".

         

      So far I change the line to "int main()" and it is fine.

         

      Thanks

        • 1. Re: No return from Main() Creator version 3
          ViDv_264506

           Hi,

             

          void main() was default setting in PSoC Creator 2.2 CP7 and older versions ....

             

          int main() is required for actual PSoC Creator 3.0 SP1 version.

             

          Manually edit and all is OK.

             

          Regards, 

             

          Viktor

          • 2. Re: No return from Main() Creator version 3
            DaHu_285096

             Hi Victor,

               

            I have been editing it every time I create a new project. My post is regarding wthere there is an update, patch or setting that saves having to edit this every time I create a new project.

            • 3. Re: No return from Main() Creator version 3
              JoMe_264151

              When I create a new empty project main.c contains the lines

                 

              #include <project.h>

                 

              and

                 

              int main()

                 

               

                 

              Probably you missed an update, did you try the Cypress Update Manager?

                 

               

                 

              Bob

              1 of 1 people found this helpful
              • 4. Re: No return from Main() Creator version 3
                ViDv_264506

                 Hi,

                   

                1. update to the PSoC Creator 3.0 SP1

                   

                2. If you wish, you can modify the template file  ...  according your wishes, tradition etc.

                   

                C:\Program Files\Cypress\PSoC Creator\3.0\PSoC Creator\templates\projects\psocexeprjbase\main.c

                   

                Regards, 

                   

                Viktor

                1 of 1 people found this helpful
                • 5. Re: No return from Main() Creator version 3
                  DaHu_285096

                   This is the version I have installed. I would have thought the latest version would have mad eth change as default and not need to delve into changing templates (I will have a look at the template though, as I want to correct this. It is not a major issue but becomes an annoyance when I am creating lots of little projects to learn PSOC.

                     

                  Environment:

                     

                  PSoC Creator  3.0 SP1 (3.0.0.3023)

                     

                  Culture: English (United States)

                     

                  OS Version: Microsoft Windows NT 6.2.9200.0

                     

                  CLR Version: 2.0.50727.8000

                     

                   

                     

                  Installed CyInstaller Products:

                     

                  PSoC Programmer 3.20.1

                     

                  PSoC Creator 3.0 SP1

                  • 6. Re: No return from Main() Creator version 3
                    DaHu_285096

                     My apologies,

                       

                    Earlier today I went to "upgrade" and left the pull down in the upgrade manager set to "Remove". After creatore was removed and I realised what I had done, I reinstalled it.

                       

                    Just now I checked the template and it does declare main with "int" return. Therefore, I proceeded to create a new project and now it does declare main loop with return type of "int"

                       

                     

                       

                    Thanks guys.