No return from Main() Creator version 3

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 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
1 Solution
ViDv_264506
Level 5
Level 5
50 sign-ins 25 sign-ins 5 solutions authored

 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
6 Replies
ViDv_264506
Level 5
Level 5
50 sign-ins 25 sign-ins 5 solutions authored

 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

0 Likes
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 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
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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
Level 5
Level 5
50 sign-ins 25 sign-ins 5 solutions authored

 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
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 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
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 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