Jump to content
  • Advertisement
Sign in to follow this  
icecubeflower

static void

This topic is 3880 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey I used to have a little function that was called all the time so I made it static static void setfy(); which I thought meant that the function is always loaded in memory so it's faster. But my main program was getting huge so I split it up into lots of .h and .cpp files and I put setfy() into a .h and .cpp file and then when I try to compile it says /home/icecube/project5/src/orient.h:39: error: 'void setfy()' used but never defined What does that mean? To make it work I have to make it a regular function but I think I want to make it static.

Share this post


Link to post
Share on other sites
Advertisement
static doesn't seem to mean what you think it does. Applied to non-member functions it means that the function has internal linkage. Internal linkage, in turn, more or less means that the definition isn't visible outside the source file it's defined in. Solution: take off the static.

Share this post


Link to post
Share on other sites
Any function that's used often will stay in memory all the time without you needing to specify anything.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!