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 (see edit history)

Share this post


Link to post
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™ (see edit history)
  • Love 2

Share this post


Link to post
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 (see edit history)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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.