cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

DaHu_285096
Contributor II

 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

0 Likes
Reply
1 Solution
ViDv_264506
Contributor II

 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

View solution in original post

0 Likes
Reply
6 Replies
ViDv_264506
Contributor II

 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

View solution in original post

0 Likes
Reply
DaHu_285096
Contributor II

 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.

0 Likes
Reply
JoMe_264151
Expert II

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

ViDv_264506
Contributor II

 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

DaHu_285096
Contributor II

 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

0 Likes
Reply
DaHu_285096
Contributor II

 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.

0 Likes
Reply