Jump to content
Mali61

[FIX]Cube Reload

Recommended Posts

i receive this

cube.cpp: In function 'void Cube_open(CHARACTER*)':
cube.cpp:289: error: ISO C++ forbids declaration of 'reload' with no type

Edit: now it's working i change auto in char and it's working fine for the moment, by the way, I love you man,i search for this for some time,you are  a gold mine

 

Edited by Undead2014

Share this post


Link to post
Share on other sites
4 hours ago, Undead2014 said:

i receive this

cube.cpp: In function 'void Cube_open(CHARACTER*)':
cube.cpp:289: error: ISO C++ forbids declaration of 'reload' with no type

Edit: now it's working i change auto in char and it's working fine for the moment

 

auto for variables specifies that the type of the variable that is being declared will be automatically deduced from its initializer, in your case, the variable type is a boolean, not char.

static bool s_isInitializedCubeMaterialInformation = false;

So, you should change it with bool instead of char or enable the c++11 mode when building (we're in 2020, everyone must have that).

You can do that by adding -std=gnu++11 (to also get GCC extensions, which are on by default), or -std=c++11 (for only ISO C++) to your compiler flags, already there're some tutorials what other changes you've to do for achieve it.

Edited by VegaS™
  • Love 2

Share this post


Link to post
Share on other sites
18 hours ago, VegaS™ said:

auto for variables specifies that the type of the variable that is being declared will be automatically deduced from its initializer, in your case, the variable type is a boolean, not char.


static bool s_isInitializedCubeMaterialInformation = false;

So, you should change it with bool instead of char or enable the c++11 mode when building (we're in 2020, everyone must have that).

You can do that by adding -std=gnu++11 (to also get GCC extensions, which are on by default), or -std=c++11 (for only ISO C++) to your compiler flags, already there're some tutorials what other changes you've to do for achieve it.

Thanks,i didn't  now this,i will try with c++11, so i will  change "char" with "bool" but i have another question...static or const ?
const bool reload = !s_isInitializedCubeMaterialInformation;

static bool reload = !s_isInitializedCubeMaterialInformation;

I saw the difference  between this terms but what should I use?

Edited by Undead2014

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.